I need help with my cmd:changeclothes
#1

This CMD must get skins from slots 1-3 and player to change his clothes
PHP код:
CMD:changeclothes(playeridparams[])
{
    new 
slotslosts;
    new 
idx GetPlayerVirtualWorld(playerid)-100;
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
idx && idx MAX_BIZ && BizInfo[idx][bType] != || idx || idx MAX_BIZ) return SendClientMessage(playeridCOLOR_GREY"You are not inside a Clothes Shop.");
    if(
sscanf(params"i"slotslosts)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /changeclothes [1-3]");
    if(
slotslosts || slotslosts 3) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /changclothes [1-3]");
        switch(
slotslosts)
    {
        case 
1:             new s1=PlayerInfo[playerid][pModel1];
                            
SetPlayerSkin(playerids1);
        case 
2:             new s2=PlayerInfo[playerid][pModel2] = modelid;
                            
SetPlayerSkin(playerids2);
        case 
3:             new s3=PlayerInfo[playerid][pModel3] = modelid;
                            
SetPlayerSkin(playerids3);
    }
    return 
1;

PHP код:
error 003declaration of a local variable must appear in a compound block
error 029
invalid expressionassumed zero
error 017
undefined symbol "s1"
error 014invalid statementnot in switch
error 001expected token";"but found ":"
error 029invalid expressionassumed zero
fatal error 107
too many error messages on one line 
Reply
#2

PHP код:
CMD:changeclothes(playeridparams[])
{
    new 
slotslostsidx GetPlayerVirtualWorld(playerid)-100;
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
idx && idx MAX_BIZ && BizInfo[idx][bType] != || idx || idx MAX_BIZ) return SendClientMessage(playeridCOLOR_GREY"You are not inside a Clothes Shop.");
    if(
sscanf(params"i"slotslosts)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /changeclothes [1-3]");
    if(
slotslosts || slotslosts 3) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /changclothes [1-3]");
    switch(
slotslosts)
    {
        case 
1SetPlayerSkin(playeridPlayerInfo[playerid][pModel1]);
        case 
2SetPlayerSkin(playeridPlayerInfo[playerid][pModel2]);
        case 
3SetPlayerSkin(playeridPlayerInfo[playerid][pModel3]);
    }
    return 
1;

Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)