Help with a simple cmd
#10

The first and bigger problem is that you've got two functions each on the lines that set the fighting style. The way you have laid out the code works with one function after an if statement, but not with more than that. You need to put the two functions inside brackets, for example:

Код:
if(!strcmp(fights, "boxing", true))
{
    SendClientMessage(playerid, 0xFFFFFF, message);
    SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
}
Secondly, because you've changed fights to a string, the line that begins else if(fights == ... will no longer work because it is checking whether a string is equal to a fighting style (an integer). You're either going to have to go through each style the user can type, checking which it is and assign a variable to the one they choose then check if it is the same as the one they have (for example, if they choose boxing, set a variable to 5 and check if that is their current fighting style). The far simpler option would just be allowing them to set the same fighting style again, as it will cause no harm - just delete that line.
Reply


Messages In This Thread
Help with a simple cmd - by waza75 - 07.04.2011, 14:35
Re: Help with a simple cmd - by Steve M. - 07.04.2011, 14:38
Re: Help with a simple cmd - by omer5198 - 07.04.2011, 14:38
Re: Help with a simple cmd - by waza75 - 07.04.2011, 14:41
Re: Help with a simple cmd - by Steve M. - 07.04.2011, 14:45
Re: Help with a simple cmd - by waza75 - 07.04.2011, 14:49
Re: Help with a simple cmd - by waza75 - 07.04.2011, 15:09
Re: Help with a simple cmd - by radhakr - 07.04.2011, 16:28
Re: Help with a simple cmd - by waza75 - 07.04.2011, 18:14
Re: Help with a simple cmd - by radhakr - 07.04.2011, 18:38
Re: Help with a simple cmd - by waza75 - 07.04.2011, 18:42
Re: Help with a simple cmd - by waza75 - 07.04.2011, 19:17
Re: Help with a simple cmd - by radhakr - 07.04.2011, 19:53

Forum Jump:


Users browsing this thread: 2 Guest(s)