SA-MP Forums Archive
/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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /makeleader command (/showthread.php?tid=180399)



/makeleader command - sekol - 01.10.2010

That's my unfinished command.
PHP код:
CMD:dajlidera(playeridparams[])
{
    new 
podaneid;
    new 
numer;
    new 
tmp[256];
    
numer strval(tmp);
    if(
sscanf(params"u"podaneid)) return SendClientMessage(playeridcolorRed"Use /dajlidera");
    if(
podaneid == INVALID_PLAYER_ID) return SendClientMessage(playeridcolorRed"Wrong player id.");
    
format(file128"/SRP/%s.ini"GetName(podaneid));
    
dini_IntSet(file"Frakcja"numer);
    return 
1;

I want to set player i select ((podaneid)) a faction of my choice. ((/dajlidera [id] [faction id]))
I'm using ZCMD and i don't know how to do it without cmdtext and other things.
Can someone just fix this code?


Re: /makeleader command - [XST]O_x - 01.10.2010

pawn Код:
CMD:dajlidera(playerid, params[])
{
    new id,faction;
    if(sscanf(params,"ud",id,faction)) return SendClientMessage(playerid,colorred,"USAGE: /dajilidera [playerid] [factionid]");
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,colorre,"ERROR: Disconnected player!");
    format(file, 128, "/SRP/%s.ini", GetName(id));
    dini_IntSet(file, "Frakcja", faction);
    return 1;
}
sscanf is very useful while trying to script multiple parameters commands


Re: /makeleader command - sekol - 01.10.2010

Thanks!