27.03.2014, 13:31
How can i make commands for 2 players name because i need a commands that for me and mine friend =.=
if (strcmp(cmdtext, "/mycommand", true) == 0)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(!strcmp(pname, "YOUR NICK"))
{
SendClientMessage(playerid, -1, "OWNED");
}
else
{
SendClientMessage(playerid, -1, "NOT OWNED!");
}
return 1;
}
if (strcmp(pname,"NICK",true)==0 || strcmp(pname,"NICK2",true)==0)
if (strcmp(cmdtext, "/yourcommand", true) == 0)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(strcmp(sendername,"Your_name",true)==0 || strcmp(sendername,"Friends_name",true)==0)
{
//your_code
}
else{
SendClientMessage(playerid, -1, "Server: Unknown Command");
}
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 5.0, 283.91, -1146.53, 80.91)) //here 5.0 is the range of the point in which he can use the cmd
{
// do this this and this
}