How to make sth. for one Name?
#4

pawn Код:
Name(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    return pname;
}
Now you can use it like this

pawn Код:
if(strcmp(Name(playerid), "Joe_", true))
{
    //stuff
}
Hope this helps.

OR you can use an enum.

pawn Код:
enum stuff
{
    name[MAX_PLAYER_NAME]
};

new st00f[MAX_PLAYERS][stuff];

public OnPlayerConnect(playerid)
{
    new n[MAX_PLAYER_NAME]; GetPlayerName(playerid, n, MAX_PLAYER_NAME);
    st00f[playerid][name] = n;

    return 1;
}
I preferably use the enum methord, but I change MAX_PLAYERS to my own value, otherwise your script will have to loop through 500.
Reply


Messages In This Thread
How to make sth. for one Name? - by XCarBOn - 25.03.2010, 14:00
Re: How to make sth. for one Name? - by woot - 25.03.2010, 14:01
Re: How to make sth. for one Name? - by XCarBOn - 25.03.2010, 14:03
Re: How to make sth. for one Name? - by Joe_ - 25.03.2010, 14:48

Forum Jump:


Users browsing this thread: 1 Guest(s)