17.12.2011, 10:22
How i can make it with strcmp
new playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
if(!strcmp(playerName, "Dark_Kostas", true, 11))//change 11 with the length of your name
{
//your command things in here
}
else return SendClientMessage(playerid, 0xFF000000, "This command is not for you!");
pawn Code:
|
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
if(!strcmp(ip, "127.0.0.1")) //change 127.0.0.1 with the IP you wish to check against
{
//rest of command
}
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(!strcmp(pname,"MyName",true)) return SendClientMessage(playerid,-1,"ERROR:You are not this player");
else
{
//do something here
}
return 1;
}
// Your Command Here
new playername[64];
GetPlayerName(playerid, playername, 64);
if(!strcmp(playername, "Name_Here", true)) {
// Code Here
}
else {
SendClientMessage(playerid, -1, "You cannot use this command");
}
return 1;
}