Change? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Change? (
/showthread.php?tid=433335)
Change? -
Affan - 27.04.2013
How can i change SERVER:Unkown command. I did search ****** but all or OnPlayerCommandText and I don't have return 0; in my code. Here is mine:
Just one example from the script.
pawn Код:
YCMD:kick(playerid, params[], help)
{
#pragma unused help
if(P_Data[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "You are not an administrator!");
new
string[128],pplayerid, reason[48];
if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /kick [Player ID/Player Name] [Reason]");
if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You can't ban admin level 5!");
format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is kick player "COL_WHITE"%s "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
SCMToAll(-1,string);
Kick(pplayerid);
return 1;
}
Re: Change? -
JaKe Elite - 27.04.2013
OnPlayerCommandPerformed
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) return //The message here. such as SendClientMessage(...);
//Checks if the command executing is failed. (Doesn't exist)
return 1;
}
Re: Change? -
Affan - 27.04.2013
Like
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) return SendClientMessage(playerid, COLOR_RED, "This command is not available!");
//Checks if the command executing is failed. (Doesn't exist)
// I don't know what to do with ^^this part
return 1;
}
Re: Change? -
JaKe Elite - 27.04.2013
Yes correct.
Remove the comment
remove this
pawn Код:
//Checks if the command executing is failed. (Doesn't exist)
// I don't know what to do with ^^this part