[Help]Changing data in a array in a enumerator?
#7

here is my example
pawn Код:
enum example {
    name[40],//string
    Float:health,//float
    score,//intiger
    bool:isconnected//boolen
}
new Variable[MAX_PLAYERS][example];

public OnPlayerConnect(playerid)
{
    new pretendscore = 42;
    GetPlayerName(playerid,Variable[playerid][name],40);//string
    GetPlayerHealth(playerid,Variable[playerid][health]);//float
    Variable[playerid][score] = pretendscore;//integer
    Variable[playerid][isconnected] = true;//boolen
    new str[128];
    if(Variable[playerid][isconnected] == true){
        format(str,128,"%s has health of %.2f with a score of %d",Variable[playerid][name],Variable[playerid][health],Variable[playerid][score]);
    }
    else if(Variable[playerid][isconnected] == false){
        str = "you wont see this";
    }
    SendClientMessage(playerid,0x000001,str);
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)