Why is the skin doesnt delete?
#1

I made a /setskin /delskin command.

the define:
pawn Код:
#define GetPlayerSkin
OnPlayerConnected:
pawn Код:
if(GetPlayerSkin == 0)
new PlayerOldSkin = GetPlayerSkin(playerid)

The commands:
pawn Код:
//---------------------------------/setskin------------------------------------
        if(strcmp(cmd, "/setskin", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] < 6) return DenyMessage(playerid, 6);
        new otherplayerid = strval(tmp)
        tmp2 = strtok(cmdtext, idx);
        new skinid = strval(tmp2)
        tmp = strtok(cmdtext, idx);
        if (strlen(tmp))
      SendClientMessage(playerid,COLOR_RED,"USAGE: /setskin [playerid] [skin ID]")
      SendClientMessage(playerid,COLOR_RED,"This command is setting player's skin to which skin you choose")
      SendClientMessage(playerid,COLOR_RED,"The skin will save forever unless you delete it/saved another skin")
      SendClientMessage(playerid,COLOR_RED,"Warning!: Dont EVER use skins number: 3-6,8,42,65,74,86,119,149,208,273,289")
      SendClientMessage(playerid,COLOR_RED,"They will crash your game!!!!!")
      return 1;
      }
        if (strlen(tmp2))
      SendClientMessage(playerid,COLOR_RED,"USAGE: /setskin [playerid] [skin ID]")
      SendClientMessage(playerid,COLOR_RED,"This command is setting player's skin to which skin you choose")
      SendClientMessage(playerid,COLOR_RED,"The skin will save forever unless you delete it/saved another skin")
      SendClientMessage(playerid,COLOR_RED,"Warning!: Dont EVER use skins number: 3-6,8,42,65,74,86,119,149,208,273,289")
      SendClientMessage(playerid,COLOR_RED,"They will crash your game!!!!!")
      return 1;
      }
        if (!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid,COLOR_RED,"Warning!: Wrong ID/Player is not connected")
        if (skinid > 0 || skinid > 299) return SendClientMessage(playerid,COLOR_RED,"Warning!: Skin ID must be between 0 and 299!")
        new playername = GetPlayerName(otherplayerid,getplayer,sizeof(getplayer));
    new adminname = GetPlayerName(playerid,giveplayer,sizeof(giveplayer));
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have been set %s(ID:%d) Skin to %d",playername,otherplayerid,skinid);
        SendClientMessage(otherplayerid,COLOR_LIGHTBLUE, "Admin %s(ID:%d) has been set your skin to %d",playerid,adminname,skinid);
        SetPlayerSkin(otherplayerid,skinid)
        GetPlayerSkin = 1
        return 1;
    }

        if(strcmp(cmd, "/delskin", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] < 6) return DenyMessage(playerid, 6);
        new otherplayerid = strval(tmp)
        tmp = strtok(cmdtext, idx);
        if (strlen(tmp))
      SendClientMessage(playerid,COLOR_RED,"USAGE: /delskin [playerid]")
      SendClientMessage(playerid,COLOR_RED,"This command is delete player's saved skin")
      SendClientMessage(playerid,COLOR_RED,"From now he can choose any skin he want,and his past skin deleted")
      SendClientMessage(playerid,COLOR_RED,"But you still can save another skin after you delete one")
      return 1;
      }
        if (!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid,COLOR_RED,"Warning!: Wrong ID/Player is not connected")
        new playername = GetPlayerName(otherplayerid,getplayer,sizeof(getplayer));
    new adminname = GetPlayerName(playerid,giveplayer,sizeof(giveplayer));
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have been delete %s(ID:%d) Saved skin!",playername,otherplayerid);
        SendClientMessage(otherplayerid,COLOR_LIGHTBLUE, "Admin %s(ID:%d) has been delete your saved skin",playerid,adminname);
        SetPlayerSkin(otherplayerid,PlayerOldSkin)
        GetPlayerSkin = 0
        return 1;
    }
but it doesnt delete the player's skin,why?
Reply
#2

make sure you set it to the right id
Reply
#3

Well I can see already OnPlayerConnect you put '=' instead of '=='
Код:
if(GetPlayerSkin = 0)
Код:
if(GetPlayerSkin == 0)
Reply
#4

Stiil dosent work,why?
Reply
#5

Becaue you're a lazy bum and can't even script basic things, you're the one who doesn't bother opening some tutorials or pre-made gamemodes watching how scripting works.
You missed some ";" and some brackets.

pawn Код:
if(strcmp(cmd, "/delskin", true) == 0)
{
    if(PlayerInfo[playerid][pAdmin] < 6) return DenyMessage(playerid, 6);
   
    new otherplayerid = strval(tmp);
    tmp = strtok(cmdtext, idx);
    if (strlen(tmp))
    {
        SendClientMessage(playerid,COLOR_RED,"USAGE: /delskin [playerid]")
        SendClientMessage(playerid,COLOR_RED,"This command is delete player's saved skin")
        SendClientMessage(playerid,COLOR_RED,"From now he can choose any skin he want,and his past skin deleted")
        SendClientMessage(playerid,COLOR_RED,"But you still can save another skin after you delete one")
        return 1;
    }
    if (!IsPlayerConnected(otherplayerid)) return SendClientMessage(playerid,COLOR_RED,"Warning!: Wrong ID/Player is not connected");
    new playername = GetPlayerName(otherplayerid,getplayer,sizeof(getplayer));
    new adminname = GetPlayerName(playerid,giveplayer,sizeof(giveplayer));
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have been delete %s(ID:%d) Saved skin!",playername,otherplayerid);
    SendClientMessage(otherplayerid,COLOR_LIGHTBLUE, "Admin %s(ID:%d) has been delete your saved skin",playerid,adminname);
    SetPlayerSkin(otherplayerid,PlayerOldSkin);
    GetPlayerSkin = 0;
    return 1;
}
Reply
#6

Shut up.
Dont help and just fuck off
and it still doesnt work
what do you have to say about that

modifiy:
yea and i dont know basic
you forgot to tell me to define the player name like this:
pawn Код:
new getplayer[MAX_PLAYER_NAME] , new giveplayer[MAX_PLAYER_NAME];
but now the /setskin is work,but /delskin doesnt work,it still have the same skin
how to fix that?
Reply
#7

Bump*
12 hours
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)