CMD:makeadvisor(playerid,params[])
{
new pID;
new sendername[MAX_PLAYER_NAME], string[36];
if(PlayerInfo[playerid][pDonatedRank] == 5) return SendClientMessage(playerid,COLOR_WHITE,"You Cannot Use This Command");
else if(PlayerInfo[playerid][pHelper] == 4) return SendClientMessage(playerid,COLOR_WHITE,"You Cannot Use This Command");
else if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_WHITE,"This Player Is Not Connected");
else
{
PlayerInfo[pID][pHelper] = 1;
GetPlayerName(playerid,sendername, sizeof(sendername));
format(string, sizeof(string),"You Have Been Set Helper By:%s",sendername);
SendClientMessage(playerid,COLOR_WHITE,"You Have Set pID A Helper");
}
return 1;
}
CMD:makeadvisor(playerid,params[])
{
new pID;
new sendername[24], receivername[24], string[36];
GetPlayerName(playerid,sendername,24);
GetPlayerName(pID, receivername, 24);
if(sscanf(params,"u",pID)) return SendClientMessage(playerid,-1,"USAGE: /makeadvisor [playerid]");
if(PlayerInfo[playerid][pDonatedRank] == 5) return SendClientMessage(playerid,COLOR_WHITE,"You Cannot Use This Command");
if(PlayerInfo[playerid][pHelper] == 4) return SendClientMessage(playerid,COLOR_WHITE,"You Cannot Use This Command");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_WHITE,"This Player Is Not Connected");
PlayerInfo[pID][pHelper] = 1;
format(string,36,"You Have Been Set To Helper Status By %s (%d).",sendername, playerid);
SendClientMessage(pID,COLOR_WHITE,string); // send the string message above to the receiver
format(string,36,"You Have Set %s (%d) To Helper Status.",receivername, pID);
SendClientMessage(playerid,COLOR_WHITE,string); // send the string message above to the admin
return 1;
}
Learn here:
https://sampwiki.blast.hk/wiki/Fast_Commands#sscanf Here is the finished/completed command (untested, should work): |
CMD:makeadvisor(playerid,params[])
{
new pID;
new sendername[24], receivername[24], string[36];
if(sscanf(params,"u",pID)) return SendClientMessage(playerid,-1,"USAGE: /makeadvisor [playerid]");
GetPlayerName(playerid,sendername,24);
GetPlayerName(pID, receivername, 24);
if(PlayerInfo[playerid][pDonatedRank] == 5) return SendClientMessage(playerid,COLOR_WHITE,"You Cannot Use This Command");
if(PlayerInfo[playerid][pHelper] == 4) return SendClientMessage(playerid,COLOR_WHITE,"You Cannot Use This Command");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_WHITE,"This Player Is Not Connected");
PlayerInfo[pID][pHelper] = 1;
format(string,36,"You Have Been Set To Helper Status By %s (%d).",sendername, playerid);
SendClientMessage(pID,COLOR_WHITE,string); // send the string message above to the receiver
format(string,36,"You Have Set %s (%d) To Helper Status.",receivername, pID);
SendClientMessage(playerid,COLOR_WHITE,string); // send the string message above to the admin
return 1;
}