If player is RCON admin, give jetpack.
#1

How can i do a if(strcmp......
/jetpack for if player is admin?
Who can make the script for me?
Reply
#2

Script request thread.
Reply
#3

pawn Код:
if(strcmp(cmd, "/jetpack", true) == 0) {
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
return 1;
}
SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
return 1;
}
Reply
#4

Less Lines:

pawn Код:
if(strcmp(cmd, "/jetpack", true) == 0) {
  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
  SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK); SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
  return 1;
}
Reply
#5

Quote:
Originally Posted by Bomba || ❶❸❸❼
pawn Код:
if(strcmp(cmd, "/jetpack", true) == 0) {
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
return 1;
}
SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
return 1;
}
You wrong. This will be, you logged RCON and typing /jetpack, then you get You can't use this command!

Код:
if(strcmp(cmd, "/jetpack", true) == 0) {
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
return 1;
}
SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
return 1;
}
Reply
#6

No, you wrong, test it.
Reply
#7

Quote:
Originally Posted by Bomba || ❶❸❸❼
No, you wrong, test it.
tested.
Your code failed.

Says You can't use this command (In RCON admin)

This code work's.

Код:
if(strcmp(cmd, "/jetpack", true) == 0) {
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
return 1;
}
SendClientMessage(playerid, 0xFF7F50AA, "You have jetpack now!");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
return 1;
}
Reply
#8

Quote:
Originally Posted by Bomba || ❶❸❸❼
No, you wrong, test it.
You were wrong because of your check, you didn't put the ! before IsPlayerAdmin.
Reply
#9

Baked banana. You are right indeed. He has to post it in the script request thread. But I must say that almost nobody will help you at there.
Reply
#10

Yeah, my copy fail Lol xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)