SA-MP Forums Archive
Why is the skin doesnt delete? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why is the skin doesnt delete? (/showthread.php?tid=91864)



Why is the skin doesnt delete? - nuriel8833 - 17.08.2009

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?


Re: Why is the skin doesnt delete? - V1ceC1ty - 17.08.2009

make sure you set it to the right id


Re: Why is the skin doesnt delete? - Abernethy - 17.08.2009

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



Re: Why is the skin doesnt delete? - nuriel8833 - 17.08.2009

Stiil dosent work,why?



Re: Why is the skin doesnt delete? - woot - 17.08.2009

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



Re: Why is the skin doesnt delete? - nuriel8833 - 17.08.2009

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?


Re: Why is the skin doesnt delete? - nuriel8833 - 18.08.2009

Bump*
12 hours