{
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_BRIGHTRED, "Armour set to 100");
}
return 1;
if (strcmp("/spawn", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to spawn");
}
return 1;
}
{
if (strcmp(cmdtext,"/armour", true, 10) == 0)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_BRIGHTRED, "Armour set to 100");
return 1;
}
if (strcmp(cmdtext,"/spawn", true, 10) == 0)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to spawn");
return 1;
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/armour", cmdtext, true, 10) == 0)
SetPlayerArmour(playerid,100);
return 1;
if (strcmp("/spawn", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to spawn");
}
return 1;
}
{
if (strcmp("/armour", cmdtext, true) == 0)
{
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_BRIGHTRED, "Armour set to 100");
return 1;
}
if (strcmp("/spawn", cmdtext, true) == 0)
{
SpawnPlayer(playerid);
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SendClientMessage(playerid, COLOR_YELLOW, "Teleported to spawn");
return 1;
}
}
CMD:armour(playerid,parmas[])
{
SetPlayerArmour(playerid,100);
SendClientMessage(playerid,COLOR_LIGHTRED,"Armour set to 100");
return 1;
}
CMD:spawn(playerid,params[])
{
SetPlayerPos(playerid,1958.3783, 1343.1572, 15.3746);
SendClientMessage(playerid,COLOR_LIGHTBLUE, "Teleported to spawn");
return 1;
}
|
it gives me no error
pawn Код:
|
CMD:armour(playerid, params[])
{
new targetid;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFF,"Error: This command is only for RCON Admins");
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /armour [PlayerID]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server!");
SetPlayerArmour(targetid, 100);
return 1;
}
|
Why you didn't return 1; at the armour?
Anyway I will agree with Michael[NBK] , ZCMD is easier/faster and best for me! May this tutorial help you [Tutorial] How to create commands with ZCMD & sscanf |