cmd help
#1

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;
}

Reply
#2

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");
}
Reply
#3

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)