Array problem, Please help.
#1

I understand this...
error 006: must be assigned to an array
in sname[ID] = name; and sstring[ID] = string;
global variable: new sname[MAX_PLAYERS], sstring[MAX_PLAYERS];

PHP код:
CMD:zinute(playerid,params[])
{
    new 
string[128], IDname[MAX_PLAYER_NAME];
    if(
sscanf(params,"uz",ID,string)) return InfoBoxForPlayer(playerid,"~r~/zinute [ID] [Text]");
    
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
         
sname[ID] = name;
    
sstring[ID] = string;
        return 
1;

Reply
#2

anybody can help me?
Reply
#3

You can't assign string values like that, you must use format.

pawn Код:
format(sname[ID], MAX_PLAYER_NAME, name);
Reply
#4

I fixed it, i change global variable to new sname[30][MAX_PLAYERS], sstring[128][MAX_PLAYERS]; but ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)