Commands - 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: Commands (
/showthread.php?tid=580722)
Commands -
ALoX12 - 07.07.2015
PHP код:
CMD:setdonator(playerid, params[])
{
new id, string[256];
if(sscanf(params, "u", id)) return SendClientMessage(playerid,RED,"[USAGE]: /setdonator [name/id]");
if(PlayerInfo[playerid][pAdmin] < 3) return 0;
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "Player not found.");
{
format(string, sizeof(string), "{009BFF}You have give %s (%d) Donator Player level", GetName(id), id);
SendClientMessage(playerid, GREEN, string);
PlayerInfo[playerid][pDonator] = 1;
}
return true;
}
Well, It does work only for id 0. What's wrong any idea?
Re: Commands -
arlindi - 07.07.2015
PHP код:
CMD:setdonator(playerid, params[])
{
new id, string[256];
if(sscanf(params, "u", id)) return SendClientMessage(playerid,RED,"[USAGE]: /setdonator [name/id]");
if(PlayerInfo[playerid][pAdmin] < 3) return 0;
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "Player not found.");
{
format(string, sizeof(string), "{009BFF}You have give %s (%d) Donator Player level", GetName(id), id);
SendClientMessage(playerid, GREEN, string);
PlayerInfo[targetid][pDonator] = 1;
}
return true;
}
Re: Commands -
ALoX12 - 07.07.2015
May i know what you did sir?
Re: Commands -
DTV - 07.07.2015
You're setting [playerid] to get the donator level, not the ID
pawn Код:
CMD:setdonator(playerid, params[])
{
new id, string[256];
if(sscanf(params, "u", id)) return SendClientMessage(playerid,RED,"[USAGE]: /setdonator [name/id]");
if(PlayerInfo[playerid][pAdmin] < 3) return 0;
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "Player not found.");
{
format(string, sizeof(string), "{009BFF}You have give %s (%d) Donator Player level", GetName(id), id);
SendClientMessage(playerid, GREEN, string);
PlayerInfo[id][pDonator] = 1; //This was most likely the problem.
}
return true;
}