How to make a specifc Teleport for Admins only? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make a specifc Teleport for Admins only? (
/showthread.php?tid=276527)
How to make a specifc Teleport for Admins only? -
rangerxxll - 14.08.2011
Sorry, I'm a bit new at scripting, but enjoying it alot. Anyways I'm just wondering what I need to add to this to make it for Admins only, thanks. (Also if you could tell me, like how to make something for LSPD only or The Army, ex: Opening a specific gate"
Quote:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/cia", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 100.7311,1920.8513,18.2811);
SendClientMessage(playerid, 0xFFFF40FF, "You have been Teleported");
return 1;
}
|
Thanks for your help guys, this community is making me a better scripter already.
Respuesta: How to make a specifc Teleport for Admins only? -
Alex_Obando - 14.08.2011
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/cia", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid, 100.7311,1920.8513,18.2811);
SendClientMessage(playerid, 0xFFFF40FF, "You have been Teleported");
SendClientMessage(playerid, -1, "You had been teleported");
return 1;
}
else
{
SendClientMessage(playerid, -1, "You are not allowed to use this command.");
return 1;
}
}
return 0;
}
Re: How to make a specifc Teleport for Admins only? -
Kitten - 14.08.2011
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsPlayerAdmin(playerid)) {
if (strcmp("/cia", cmdtext, true, 10) == 0) {
SetPlayerPos(playerid, 100.7311,1920.8513,18.2811);
SendClientMessage(playerid, 0xFFFF40FF, "You have been Teleported");
}
}
return 1;
}
// making it only teams you need to define some shortcuts and variables
//example below
new gTeam[MAX_PLAYERS];
#define TEAM_ARMY 0
#define TEAM_LSPD 1
if(gTeam[playerid] == TEAM_ARMY)
{
if (strcmp("/army", cmdtext, true, 10) == 0) {
//army only can do here
}
Re: How to make a specifc Teleport for Admins only? -
rangerxxll - 14.08.2011
Wow thats really simple. Thank you very much.
Re: How to make a specifc Teleport for Admins only? -
PrawkC - 14.08.2011
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/cia", cmdtext, true, 10) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "This is an admin only command!");
SetPlayerPos(playerid, 100.7311,1920.8513,18.2811);
SendClientMessage(playerid, 0xFFFF40FF, "You have been Teleported");
}
return 1;
}
Re: How to make a specifc Teleport for Admins only? -
rangerxxll - 14.08.2011
Btw, stupid question. How do I make a pawn code instead of quotes? I don't see an option for it.
Respuesta: How to make a specifc Teleport for Admins only? -
Alex_Obando - 14.08.2011
Use
Re: How to make a specifc Teleport for Admins only? -
Kitten - 14.08.2011
Quote:
Originally Posted by rangerxxll
Btw, stupid question. How do I make a pawn code instead of quotes? I don't see an option for it.
|
..... [code] /code]
Re: How to make a specifc Teleport for Admins only? -
rangerxxll - 14.08.2011
Thanks.
Re: How to make a specifc Teleport for Admins only? -
Kush - 14.08.2011
Quote:
Originally Posted by rangerxxll
Thanks.
|
[php] /php]