Need example with makeleader 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: Need example with makeleader command (
/showthread.php?tid=571731)
Need example with makeleader command -
NoDi522 - 21.04.2015
I have got three organizations/factions.
Hospital
PD(PoliceDepartment)
Civilian(Not organization... However :P)
So i need a little example with /makeleader [name/id] [ORGname].
I tried to make it but i get more than 10 errors so i quit
Thank you for you support.
Re: Need example with makeleader command -
Azula - 21.04.2015
show us your try
Re: Need example with makeleader command -
NoDi522 - 21.04.2015
DELETED! Because of errors and i couldn't compile and start my server. I am using sscanf and zcmd. So if you could help thank you. You don't have to put explanations and stuff like that!
Re: Need example with makeleader command -
Azula - 21.04.2015
PHP код:
#define IsAdm PlayerInfo[playerid][pAdmin]
#define IsFac[%0] PlayerInfo[%0][pClan]
#define IsFacLead[%0] PlayerInfo[%0][pClLeader]
CMD:makeleader(playerid, params[])
{
if(Logged[playerid] == 1)
{
new targetid, amount, string[128];
if( IsAdm < 5) return SendClientMessage(playerid, -1, "ERROR:{FFFFFF} You are not authorized to use that command.");
if(sscanf(params, "ud", targetid, amount)) return SendClientMessage(playerid, -1, "USAGE:{FFFFFF} /makeleader [playerid] [ID]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "ERROR:{FFFFFF} That player isn't online.");
if( IsFac[targetid] != 0) return SendClientMessage(playerid, -1, "ERROR:{FFFFFF} That player is already a member of a clan.");
if( IsFacLead[targetid] != 0) return SendClientMessage(playerid, -1, "ERROR:{FFFFFF} That player is already a leader of a clan.");
if(amount > 6) return SendClientMessage(playerid, -1,"ERROR:{FFFFFF} You can only choose from 1-6.");
if(amount < 1) return SendClientMessage(playerid, -1, "ERROR:{FFFFFF} You can only choose from 1-6.");
else
{
format(ClanInfo[amount-1][cLeader], 128, "%s", GetName(targetid));
ClanInfo[amount-1][cMembers]++;
IsFac[targetid] = amount;
IsFacLead[targetid] = 6;
SaveFact(IsFac[targetid]-1); // IsFac[targetid]-1 the new id of fact or clan :p
}
}
return 1;
}
you need to make yourself the save i havent any informations about your stock system save
Re: Need example with makeleader command -
NoDi522 - 21.04.2015
You made this for 10 minutes i would making this 10 days!! Thanks !! Rep+