SA-MP Forums Archive
Give 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: Give command (/showthread.php?tid=635238)



Give command - Loinal - 04.06.2017

fixed


Re: Give command - Kane - 04.06.2017

You only have two parameters set? pid and Thing.

What are you meant to be giving here?


Re: Give command - Loinal - 04.06.2017

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
You only have two parameters set? pid and Thing.

What are you meant to be giving here?
Player id and thing to give


Re: Give command - StackedPizza - 04.06.2017

The following errors occurred with your submission:
The message you have entered is too short. Please lengthen your message to at least 4 characters.

Quote:

CMD:give(playerid, params[])
{
if(pData[playerid][Admin] >= 3)
{
new pid;
new str[250];
if(sscanf(params, "us[64]", pid, params)) return SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "USAGE: /give [Player ID] [Any Thing]");
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_MESSAGE_YELLOW, "PlayerID is not connected.");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
PlayerPlaySound(pid, 1057, 0.0, 0.0, 0.0);
format(str, sizeof(str), "* Admin %s (ID:%d) gave %s (ID: %d) %s",GetName(playerid),playerid,GetName(pid),pid,pa rams);
SendClientMessageToAll(0xB9FF00FF, str);
format(str,sizeof(str),"~g~~h~%s",params);
GameTextForPlayer(pid,str,3000,4);
new irc[130];
format(irc,sizeof(str),"0,13* Admin %s (ID:%d) gave %s (ID: %d) %s",GetName(playerid), playerid, GetName(pid),pid,params);
IRC_GroupSay(groupID, IRC_CHANNEL, irc);
return 1;
}
else return ShowMessage(playerid,COLOR_YELLOW,1,3);
}




Re: Give command - DavidBilla - 04.06.2017

You didn't give any string size to Thing.

Change
new Thing;
to
new Thing [64];


Re: Give command - SoFahim - 04.06.2017

Whatever you do with CMD:***( playerid, params[] )

Always follow this method, otherwise you will get errors with " Unknown command ".
Код:
CMD:commandname( playerid, params[] )
{
.....
...
return 1;
}