Personal use command
#1

Hello guys, today I wanna ask is it possible to create a command for one player use?
Example: My name is abcdef and I can use command: /adwaok but other people can't use this command...
Is it possible?
Reply
#2

I don't know if this is possible, but you could try to make it admin only and create a new admin rank, or if your the only server owner for example: [pAdmin] ==
Reply
#3

That will cost me some times...
The command is for someone...
Reply
#4

You could check with strcmp if the name matches
pawn Код:
CMD:adwaok(playerid, params[]) {
    new
        name[MAX_PLAYER_NAME]
    ;
    GetPlayerName(playerid, name, sizeof name);
    if(strcmp(name, "abcdef ", false) == 0) {
        return true;
    }
    return false;
}
But this is only secure if the players need to login after connection otherwise everyone just could take his name and use the command
Reply
#5

this is tutorial

pawn Код:
CMD:healme(playerid,params[])
{
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    if(!strcmp(playername, "Guest123", true))
    #pragma unused params
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,100);
    SendClientMessage(playerid, -1, "you was healed !");
    }
    else return SendClientMessage(playerid, -1, "ERROR: You're Not Guest123!");
    return 1;
}
Reply
#6

Thank you guest, it worked!
+REP
Can I ask 1 more? how to add 3D text label for only 1 person? just like the question Personal use command
Reply
#7

PHP код:
    new accname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridaccnamesizeof(accname));
    if(!
strcmp(accname"THENAME"true))
    {
     
//3d text label code here
    

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)