18.07.2010, 09:06
(
Последний раз редактировалось Ash.; 18.07.2010 в 09:20.
Причина: My fix, but still some problems...
)
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:
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!
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;
}
}
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!