OnPlayerCommandText problem...
#1

Hi all, again.

Im having a few problems with some commands in an OnPlayerCommandText section. All commands around the problem in question work, and im not having problems with them. However the problem im having is with commands that have 'if' in them.

Here's the section that doesnt work:

pawn Код:
// Most Valued Workers...
    if (strcmp("/mvw", cmdtext, true) == 0)
    {
        if (GetPlayerScore(playerid) < 99)
        {
            SendClientMessage(playerid, MVW, "You are a Most Valued Worker");
            SendClientMessage(playerid, MVW, "Here are commands that you can use:");
            SendClientMessage(playerid, MVW, "-----------------------------------");
            SendClientMessage(playerid, MVW, "/fix /nos /hy /tune");
            return 1;
        }
    }

    if (strcmp("/fix", cmdtext, true))
    {
        if (GetPlayerScore(playerid) < 99)
        {
            RepairVehicle(GetPlayerVehicleID(playerid));
            return 1;
        }
    }

    if (strcmp("/nos", cmdtext, true))
    {
        if (GetPlayerScore(playerid) < 99)
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            return 1;
        }
    }
    if (strcmp("/hy", cmdtext, true))
    {
        if (GetPlayerScore(playerid) < 99)
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
            return 1;
        }
    }
    if (strcmp("/tune", cmdtext, true))
    {
        if (GetPlayerScore(playerid) < 99)
        {
            RepairVehicle(GetPlayerVehicleID(playerid));
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); // NOS
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1087); // Hydraulics
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1082); //Wheels
            ChangeVehicleColor(GetPlayerVehicleID(playerid), -1, -1); //Colour
            return 1;
        }
    }
I would be very grateful if you could help me get this working. If you require the whole script let me know, although the rest of the script works.

EDIT: I have fixed the script by turning all the math symbols around. (Maths isnt my strong point) However the only command that works is /nos - Could somebody please take a look?

Thanks
Ash!
Reply


Messages In This Thread
OnPlayerCommandText problem... - by Ash. - 18.07.2010, 09:06
Re: OnPlayerCommandText problem... - by Jeffry - 18.07.2010, 09:10
Re: OnPlayerCommandText problem... - by Ash. - 18.07.2010, 09:21
Re: OnPlayerCommandText problem... - by Ash. - 18.07.2010, 09:39
Re: OnPlayerCommandText problem... - by Jeffry - 18.07.2010, 09:41
Re: OnPlayerCommandText problem... - by Ash. - 18.07.2010, 09:46
Re: OnPlayerCommandText problem... - by Jeffry - 18.07.2010, 09:53

Forum Jump:


Users browsing this thread: 1 Guest(s)