a simple problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: a simple problem (
/showthread.php?tid=252047)
a simple problem -
fubar - 29.04.2011
ok folks because i forget alot of stuff due to being old i made this cmd ages ago and it didnt work, then i forgot all about it, so i will know throw it open to someone to help me out please,its probally something realy easy,but my brain doesnt work at the moment
Код:
CMD:doughnut(playerid,params[]) {
new giveplayerid,string[128],giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME];
if (sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /doughnut <ID> ");
if(PlayerInfo[playerid][Jailed] == 1) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "You are in jail and cannot use this command");
return 1;}
if (IsPlayerConnected(giveplayerid)){
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s has given %s a doughnut,hope he doesnt leave crumbs every where", sendername, giveplayer);
SendClientMessageToAll(COLOR_INDIGO, string);
return 1;}
else{
format(string, sizeof(string), "ID:%d is not an active player ID number.", giveplayerid);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);}
return 1;}
cheers for your help in advance
Re: a simple problem -
Vince - 29.04.2011
So, what exactly doesn't work, apart from the fact that you're only sending messages?
Re: a simple problem -
fubar - 29.04.2011
o sorry my bad,it is surpose to send a message to the player that he has been given a doughnut ,but thats the part that doesnt work