Skinsave
#1

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.
Reply
#2

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.
Reply
#3

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.

Reply
#4

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

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]);

Reply
#6

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

Yeah,
Quote:

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

Those are my includes
Reply
#8

Make sure this is outside any Publics.

pawn Код:
new PlayerSkin[MAX_PLAYERS];
Reply
#9

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, :/
Reply
#10

Can you show us line 70? Not 632
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)