06.08.2013, 22:22
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
//if (strcmp("/weapon", cmdtext, true, 5) == 0)
//if (strcmp("/weapon", cmdtext, true, 7) == 0) // 7 lenght, not 5. Lenght is option so this is easier and simplier
if (!strcmp("/weapon", cmdtext, true)) // 7 lenght, not 5. Lenght is option so this is easier
{
GivePlayerWeapon (playerid, 26, 500);
return 1;
}
//if (strcmp("/armor", true) == 0)
if (!strcmp("/armor", cmdtext, true)) // comparing string1 with true, missing string2
{
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, 0xFFFFFF, "You now have 100 armor.");
return 1;
}
return 0;
}