What's wrong with my code?
Hi. I'm trying to create a new Jailmod. A JailMod that works and its free. But I'm new at pawn/amx scripting, and I really don't know what to do. How it should be?
Description: At the start of the round, I wanted to check if the player are CT. If yes, then give him M4A1, etc... If not, then strip weapons and give a knife. And at the end of the round, it will strip weapons and give a knife :) Here is my code: PHP Code:
Quote:
|
Re: What's wrong with my code?
Round End and New Round events are global. They don't act on any one person. (i.e. you can't just use "id" and expect it to work, you need to get it defined first)
I suggest making a simple test plugin first. Somebody else might be able to help you with your current endeavor however. |
Re: What's wrong with my code?
It won't work, like fysiks said it's global events, you can not pass the id like that. You have to loop through all players.
|
Re: What's wrong with my code?
Maybe something like this:
PHP Code:
|
Re: What's wrong with my code?
Yes more like that, though you could use the cs native to give ammos.
|
Re: What's wrong with my code?
Really thank you guys :)
Alucard, thank you, but I think there is something wrong. In new round, I don't get m4a1 and either my knife get stripped. Should I use Ham with Player Spawn + if (get_user_team(i) == 2) ? //EDIT I tested it with HamSandWich and it worked :D here is the code: PHP Code:
|
Re: What's wrong with my code?
If you do it that way then you can use the player id in the hamsandwich forward.
PHP Code:
|
Re: What's wrong with my code?
Small improve :0
PHP Code:
|
Re: What's wrong with my code?
Thank you Bugsy. Thank you xPaw :D
I have a question: I tested this plugin alone (only me in the server). I called a friend to help me testing, and when he connects (not spawn) my weapons are stripped and i get again M4A1, and etc. How do I fix it? |
Re: What's wrong with my code?
show new code please
|
| All times are GMT -4. The time now is 18:24. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.