[HELP] If players name = 'example' do this action
#1

Im not 100% sure how to set this up so im asking you guys/girls for help.

What i want to do is if a player has a certain name it will do something. So for example...


If the players name = indy-greg
Do this action

I dont care about the action i can sort that out. Its just, how do i set up the if the players name = <whatevername>

Thanks for your help

Reply
#2

Use strcmp function.
Reply
#3

Quote:
Originally Posted by [HLF
It's using strcmp anyway.
Reply
#4

Add this function to check the name of the player.
Then define a function to it (Example: GivePlayerMoney, RemovePlayerFromVehicle ,...)

pawn Код:
new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
pawn Код:
if(strcmp(PlayerName,"indy-greg",true))
{
Is just one example!
Reply
#5

Quote:
Originally Posted by ► © The LuxurioN™
Add this function to check the name of the player.
Then define a function to it (Example: GivePlayerMoney, RemovePlayerFromVehicle ,...)

pawn Код:
new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
pawn Код:
if(strcmp(PlayerName,"indy-greg",true))
{

Is just one example!
That is EXACTLY the thing i needed. Thanks very much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)