Get a name for use?
#1

Код:
forward VIPHealth(playerid);
public VIPHealth(playerid)
{
if(GetPlayerName(playerid, == "BL1nk")
{
SetPlayerHealth(playerid, 999999999999999);
}
}
EDIT: forgot to type

Anyways, i want to check a players name, such as "BL1nk"

If the players name Is "BL1nk" he has god health.
Reply
#2

pawn Код:
forward VIPHealth(playerid);
public VIPHealth(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    if(!strcmp(pname, "BL1nk", true))
    {
        SetPlayerHealth(playerid, 99999);
    }
}
Strcmp to compare strings, not a very good system you have there though you'll have to script every vips players name into your script.
Reply
#3

Well, just doing it for my name :P thanks bro.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)