Help me !!
#1

I have a problem, i use a script like that :

pawn Код:
#define TEAM_Red 2

public OnPlayerConnect(playerid)
{
        SetPlayerClass(playerid, "Red");
        return 1;
}

stock GetPlayerClass(playerid)
{
     new asd[64];
     GetPVarString(playerid, "Class", asd, 64);
     return asd;
}

forward SetPlayerClass(playerid, class[]);
public SetPlayerClass(playerid, class[])
{
     new skin[32], asdf;
     SetPVarString(playerid, "Class", class);
     format(skin, 32, "TEAM_%s", class);
     asdf = "#skin";
}
When I compile, I got error :

Код:
error 006: must be assigned to an array
How do I fix this error ?
Thanks
Reply
#2

May I ask what line it is on?
Reply
#3

pawn Код:
forward SetPlayerClass(playerid, class[]);
public SetPlayerClass(playerid, class[])
{
     new skin[32], asdf;
     SetPVarString(playerid, "Class", class);
     format(skin, 32, "TEAM_%s", class);
     asdf = "#skin";
}
Your problem (from what i can see) is that you are trying to assign "#skin" into a variable that is not compatible with strings. Try defining asdf as asdf[5].

Without more information thats all i can suggest.
Reply
#4

Quote:
Originally Posted by Pghpunkid
Посмотреть сообщение
pawn Код:
forward SetPlayerClass(playerid, class[]);
public SetPlayerClass(playerid, class[])
{
     new skin[32], asdf;
     SetPVarString(playerid, "Class", class);
     format(skin, 32, "TEAM_%s", class);
     asdf = "#skin";
}
Your problem (from what i can see) is that you are trying to assign "#skin" into a variable that is not compatible with strings. Try defining asdf as asdf[5].

Without more information thats all i can suggest.
No... I will create the function become :
pawn Код:
forward SetPlayerClass(playerid, class[]);
public SetPlayerClass(playerid, class[])
{
     new skin[32], asdf;
     SetPVarString(playerid, "Class", class);
     format(skin, 32, "TEAM_%s", class);
     asdf = "#skin";
     SetPlayerSkin(playerid, asdf);
}
I mean when player spawned, the skin is become TEAM_(player class), so player skin will become skinid 2 if they are red team. But if I using asdf[5] Im get an error :

Код:
error 035: argument type mismatch (argument 2)
Quote:
Originally Posted by nmader
Посмотреть сообщение
May I ask what line it is on?
In a end of the line, at asdf = "#skin";

Sorry for my bad English
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)