SA-MP Forums Archive
Skinsave - 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)
+--- Thread: Skinsave (/showthread.php?tid=504635)



Skinsave - Counterafk - 05.04.2014

Hi, I have a skin filterscript which allows me to use /skin ID, but whenever that player dies, it goes back to the default addplayerclass one. Im still learning,


Copied theese from the gamemode script

#define playerskin

public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerSkin(playerid, playerskin);
return 1;

public OnPlayerSpawn(playerid)
{
SetPlayerSkin(playerid, playerskin);
return 1;
}

Probably wrong, but I atleast tried doing it myself haha.


Re: Skinsave - Dokins - 05.04.2014

pawn Код:
new PlayerSkin[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    GetPlayerSkin(playerid, PlayerSkin[playerid]);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid, PlayerSkin[playerid]);
    return 1;
}

Well done for trying, but for it to work it must be a global variable.


Re: Skinsave - Counterafk - 05.04.2014

Thank you for the quick response! Somehow theres an error. Do I need to have zcmd or any other include like that? Something tells me that those square brackets are custom maybe?

Quote:

C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 629) : error 029: invalid expression, assumed zero
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 629) : warning 215: expression has no effect
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 629) : error 001: expected token: ";", but found "]"
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 629) : error 029: invalid expression, assumed zero
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 629) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.




Re: Skinsave - Dokins - 05.04.2014

Can you show me the error line? The brackets are where a variable is located.


Re: Skinsave - Counterafk - 05.04.2014

Quote:
Originally Posted by Dokins
Посмотреть сообщение
Can you show me the error line? The brackets are where a variable is located.
This is the error line
Quote:

SetPlayerSkin(playerid, PlayerSkin[playerid]);




Re: Skinsave - Dokins - 05.04.2014

Do you have <a_samp> at the top of your script?


Re: Skinsave - Counterafk - 05.04.2014

Yeah,
Quote:

#include <a_samp>
#include <core>
#include <float>
#include <zcmd>

Those are my includes


Re: Skinsave - Dokins - 05.04.2014

Make sure this is outside any Publics.

pawn Код:
new PlayerSkin[MAX_PLAYERS];



Re: Skinsave - Counterafk - 05.04.2014

Quote:

C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 70) : error 020: invalid symbol name ""
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 632) : error 029: invalid expression, assumed zero
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 632) : warning 215: expression has no effect
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 632) : error 001: expected token: ";", but found "]"
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 632) : error 029: invalid expression, assumed zero
C:\Users\John\Desktop\freeroam\gamemodes\bare.pwn( 632) : fatal error 107: too many error messages on one line

Tried placing the "new PlayerSkin[MAX_PLAYERS];" above the onplayerconnect public, :/


Re: Skinsave - CroM256 - 05.04.2014

Can you show us line 70? Not 632