if (strcmp, if it is an Admin
#1

How can i do this?

Quote:

if (strcmp("/heal", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "You are succefully healed!");
SetPlayerHealth(playerid, 100);

return SendClientMessage(playerid,COLOR_RED,"Sorry, you are not a Admin!");
}

I want to do this, but i forgot how i can make this only for admins..
So if a non-admin types /heal it says you aren ot a admin and if a
admin does this is must heal the player to 100 HP...

Reply
#2

pawn Код:
if (strcmp("/heal", cmdtext, true, 10) == 0)
  {
if(IsPlayerAdmin(playerid)) // That means RCON Admin.
{
   SendClientMessage(playerid, COLOR_YELLOW, "You are succefully healed!");
        SetPlayerHealth(playerid, 100);
}
else
{

 SendClientMessage(playerid,COLOR_RED,"Sorry, you are not a Admin!");
}
return 1;
}
Reply
#3

Quote:
Originally Posted by ikarus❶❸❸❼
pawn Код:
if (strcmp("/heal", cmdtext, true, 10) == 0)
  {
if(IsPlayerAdmin(playerid)) // That means RCON Admin.
{
   SendClientMessage(playerid, COLOR_YELLOW, "You are succefully healed!");
        SetPlayerHealth(playerid, 100);
}
else
{

 SendClientMessage(playerid,COLOR_RED,"Sorry, you are not a Admin!");
}
return 1;
}
Thank you very very much, do you know how i can do /kick and then ID?
So if im an admin and i do /kick [Name/ID]...
And a /veh command to spawn a vehicle.. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)