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


Messages In This Thread
Why is the skin doesnt delete? - by nuriel8833 - 17.08.2009, 06:45
Re: Why is the skin doesnt delete? - by V1ceC1ty - 17.08.2009, 07:41
Re: Why is the skin doesnt delete? - by Abernethy - 17.08.2009, 07:55
Re: Why is the skin doesnt delete? - by nuriel8833 - 17.08.2009, 08:17
Re: Why is the skin doesnt delete? - by woot - 17.08.2009, 09:43
Re: Why is the skin doesnt delete? - by nuriel8833 - 17.08.2009, 09:57
Re: Why is the skin doesnt delete? - by nuriel8833 - 18.08.2009, 09:59

Forum Jump:


Users browsing this thread: 1 Guest(s)