[Question]How to make a command admin only? -
[AXS]Bryce - 19.03.2010
hey i was just wondering, since i made an admin villiage, how to make the teleport an admin only command?
heres what i got... for starters..
oh i dno how to do one of those box thingos coz im kinda noob at general stuff.. lol :P
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminship", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 3203.9760,-1472.5383,16.6099);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admin Ship!");
return 1;
}
return 0;
Re: [Question]How to make a command admin only? -
[WF]Demon - 19.03.2010
Top Of Script
new Admin[MAX_PLAYERS];
Command
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminship", cmdtext, true, 10) == 0)
{
if(Admin[playerid] == 1)
}
SetPlayerPos(playerid, 3203.9760,-1472.5383,16.6099);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admin Ship!");
return 1;
}
return 0;
tell me what you get, also
Make Yourself admin
if (strcmp("/makemeadmin",cmdtext, true, 10) == 0)
{
Admin[playerid] = 1;
return 1;
}
Re: [Question]How to make a command admin only? -
[LSR]State_Trooper - 19.03.2010
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminship", cmdtext, true, 10) == 0)
{
IsPlayerAdmin(playerid) ;
{
SetPlayerPos(playerid, 3203.9760,-1472.5383,16.6099);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admin Ship!");
return 1;
}
return 0;
That should do it.
Re: [Question]How to make a command admin only? -
Deat_Itself - 19.03.2010
Quote:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminship", cmdtext, true, 10) == 0)
{
IsPlayerAdmin(playerid) ;
{
SetPlayerPos(playerid, 3203.9760,-1472.5383,16.6099);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admin Ship!");
return 1;
}
return 0;
|
thats wrong
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminsship", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid, 3203.9760,-1472.5383,16.6099);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admins Ship!");
}
return 1;
}
return 0;
that should work
Re: [Question]How to make a command admin only? -
[AXS]Bryce - 19.03.2010
_saif_, your way does work but when i type /adminship as NOT an admin it doesnt take me there but it still says 'welcome to adminship'
Re: [Question]How to make a command admin only? -
aircombat - 19.03.2010
try that :
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminship", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid)
{
SetPlayerPos(playerid, 3203.9760,-1472.5383,16.6099);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admin Ship!");
return 1;
}
else { SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admin Ship!"); }
return 1;
}
return 0;
}
Re: [Question]How to make a command admin only? -
Deat_Itself - 19.03.2010
Quote:
Originally Posted by [AC
Etch ]
try that :
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminship", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid) ;
{
SetPlayerPos(playerid, 3203.9760,-1472.5383,16.6099);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admin Ship!");
return 1;
}
else { SendClientMessage(playerid, COLOR_GREEN, "Welcome to Admin Ship!"); }
return 1;
}
return 0;
}
|
you have missed this .
if(!IsPlayerAdmin(playerid))
return 0;
Bryce now it will show Unknown command to non admins
Re: [Question]How to make a command admin only? -
aircombat - 19.03.2010
edited
Re: [Question]How to make a command admin only? -
[AXS]Bryce - 19.03.2010
k its all good now.. thanks heaps guys!
Re: [Question]How to make a command admin only? -
aircombat - 19.03.2010
Np