SA-MP Forums Archive
cmd help - 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: cmd help (/showthread.php?tid=492961)



cmd help - bboytimix - 06.02.2014

hey
i want to do if player changed Zclass
he will get text like
class setted on zombie slot
and if Sclass
class setted on Survivor slot

Quote:

CMD:setclass(playerid,params[])
{
if(PInfo[playerid][Premium] == 0) return SendClientMessage(playerid,white,"* "cred"You are not allowed to use this command ONLY PREMIUM CAN!");
new class,id;
if(sscanf(params,"ii",id,class)) return SendClientMessage(playerid,orange,"USAGE: "cblue"/setclass <team> <classid> "cgrey"1 = Survivor | 2 = Zombie");
if(id == 1) PInfo[playerid][Sclass] = class-1;
else if(id == 2) PInfo[playerid][Zclass] = class-1;
SendClientMessage(playerid,0xCCCCFF,"You have successfully changed your class.");
return 1;
}




Re: cmd help - Konstantinos - 06.02.2014

Change:
pawn Код:
if(id == 1) PInfo[playerid][Sclass] = class-1;
else if(id == 2) PInfo[playerid][Zclass] = class-1;
SendClientMessage(playerid,0xCCCCFF,"You have successfully changed your class.");
to:
pawn Код:
if(id == 1)
{
    PInfo[playerid][Sclass] = class-1;
    SendClientMessage(playerid,0xCCCCFF,"class setted on Survivor slot");
}
else if(id == 2)
{
    PInfo[playerid][Zclass] = class-1;
    SendClientMessage(playerid,0xCCCCFF,"class setted on zombie slot");
}



Re: cmd help - bboytimix - 06.02.2014

Thanx !!!!!!!
and i gotone more prob with
im rank 1 and i can use the class 2+
i want if player rank =5
he can use class 1,2,3,4,5 but not more then his rank

pawn Код:
CMD:setclass(playerid,params[])
{
    if(PInfo[playerid][Premium] == 0) return SendClientMessage(playerid,white,"* "cred"You are not allowed to use this command ONLY PREMIUM CAN!");
    if(PInfo[playerid][Rank] > 0) return SendClientMessage(playerid,white,"» Error: "cred"you don't have that class!");
    new class,id;
    if(sscanf(params,"ii",id,class)) return SendClientMessage(playerid,orange,"USAGE: "cblue"/setclass <team> <perkid> "cgrey"1 = Survivor | 2 = Zombie");
    if(id == 1)
    {
        PInfo[playerid][Sclass] = class-1;
        SendClientMessage(playerid,0xCCCCFF,"class setted on Survivor slot");
    }
    else if(id == 2)
    {
        PInfo[playerid][Zclass] = class-1;
        SendClientMessage(playerid,0xCCCCFF,"class setted on zombie slot");
    }
    return 1;
}