/givemoney command - 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: /givemoney command (
/showthread.php?tid=447044)
/givemoney command -
Elietje28 - 28.06.2013
I guys!
I'm making a /givemoney command, but when I use the command, the server says: unknown command.
Код:
if(!strcmp(cmdtext, "/givemoney", true))
{
new cmd[128],param1[130], param2[130],string[130],name1[MAX_PLAYER_NAME+1],name2[MAX_PLAYER_NAME+1];
if(sscanf(cmdtext,"sdd",cmd[100],param1[128],param2[128]))
return
SendClientMessage(playerid, COLOR_WHITE, "GEBRUIK: /givemoney [spelerid] [bedrag] (=[playerid] [amount]");
if(!IsPlayerConnected(param1[128]))
return
SendClientMessage(playerid, COLOR_RED, "Het door jouw ingegeven spelerid is niet verbonden. (=player isn't connected");
GivePlayerMoney(param1[128],param2[128]);
GetPlayerName(playerid, name1, MAX_PLAYER_NAME);
GetPlayerName(param1[128], name2, MAX_PLAYER_NAME);
format(string,sizeof(string),"%s heeft $ %d aan %s gegeven.", name1, param2, name2);
SendClientMessageToAll(COLOR_INDIGO, string);
return 1;
}
What do I do wrong?
thanks
Re: /givemoney command -
Elietje28 - 28.06.2013
anyone?
Re: /givemoney command -
MarioVPS - 28.06.2013
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/givemoney", cmdtext, true, 10) == 0)
{
new cmd[128],param1[130], param2[130],string[130],name1[MAX_PLAYER_NAME+1],name2[MAX_PLAYER_NAME+1];
if(sscanf(cmdtext,"sdd",cmd[100],param1[128],param2[128]))
return
SendClientMessage(playerid, COLOR_WHITE, "GEBRUIK: /givemoney [spelerid] [bedrag] (=[playerid] [amount]");
if(!IsPlayerConnected(param1[128]))
return
SendClientMessage(playerid, COLOR_RED, "Het door jouw ingegeven spelerid is niet verbonden. (=player isn't connected");
GivePlayerMoney(param1[128],param2[128]);
GetPlayerName(playerid, name1, MAX_PLAYER_NAME);
GetPlayerName(param1[128], name2, MAX_PLAYER_NAME);
format(string,sizeof(string),"%s heeft $ %d aan %s gegeven.", name1, param2, name2);
SendClientMessageToAll(COLOR_INDIGO, string);
return 1;
}
return 0;
}