need help command
#1

hi i need help

anyone know how to make a /get and a /goto command?


ty alot :P
Reply
#2

here.. use this .. you will define the admin and other things yourself .. you need to put a little work not just ask .. but here take mine

Код:
if(strcmp(cmd,"/goto",true)==0)
		{
			tmp = strtok(cmdtext,idx);

			if(!strlen(tmp)) {
				SendClientMessage(playerid,0xFFFF00AA,"USAGE: /goto [playerid]");
			}

		if(Admin[playerid] >= 1)

		{
				chosenplayer = strval(tmp);

				GetPlayerPos(chosenplayer,xpos[0],ypos[0],zpos[0]);
				SetPlayerPos(playerid,xpos[0]+2,ypos[0]+2,zpos[0]);

				format(string,sizeof(string),"You have been teleported to %s.",originalplayername[chosenplayer]);
				SendClientMessage(playerid,COLOR_RED,string);
				format(string,sizeof(string),"%s has teleported to you.",originalplayername[playerid]);
				SendClientMessage(chosenplayer,COLOR_RED,string);
				format(string,sizeof(string),"/getin2 %d",chosenplayer);
				OnPlayerCommandText(playerid,string);
			}
		}
Reply
#3

Who says he has your variables?

What GM do you use? Do you have any admin system?
Reply
#4

Quote:
Originally Posted by [SaRp
Ryder ]
here.. use this .. you will define the admin and other things yourself .. you need to put a little work not just ask .. but here take mine

Код:
if(strcmp(cmd,"/goto",true)==0)
		{
			tmp = strtok(cmdtext,idx);

			if(!strlen(tmp)) {
				SendClientMessage(playerid,0xFFFF00AA,"USAGE: /goto [playerid]");
			}

		if(Admin[playerid] >= 1)

		{
				chosenplayer = strval(tmp);

				GetPlayerPos(chosenplayer,xpos[0],ypos[0],zpos[0]);
				SetPlayerPos(playerid,xpos[0]+2,ypos[0]+2,zpos[0]);

				format(string,sizeof(string),"You have been teleported to %s.",originalplayername[chosenplayer]);
				SendClientMessage(playerid,COLOR_RED,string);
				format(string,sizeof(string),"%s has teleported to you.",originalplayername[playerid]);
				SendClientMessage(chosenplayer,COLOR_RED,string);
				format(string,sizeof(string),"/getin2 %d",chosenplayer);
				OnPlayerCommandText(playerid,string);
			}
		}
and you know /get ?
Reply
#5

Quote:
Originally Posted by MenaceX^
Who says he has your variables?

What GM do you use? Do you have any admin system?
im using SDR

but im making my own admin FS
Reply
#6

i use my own Gm ... Tec9 gangsta RPG .. i used to be known as [Tec9]Ryder
ye i have my own admin system why ?
Reply
#7

Quote:
Originally Posted by [SaRp
Ryder ]
i use my own Gm ... Tec9 gangsta RPG .. i used to be known as [Tec9]Ryder
ye i have my own admin system why ?
i need /get code -.-
Reply
#8

here
Код:
if(strcmp(cmd,"/bring",true)==0)
		{
			tmp = strtok(cmdtext,idx);

			if(!strlen(tmp)) {
				SendClientMessage(playerid,0xFFFF00AA,"USAGE: /bring [playerid]");
			}

 if(Admin[playerid] >= 1)

		{

				chosenplayer = strval(tmp);

				GetPlayerPos(playerid,xpos[0],ypos[0],zpos[0]);
				SetPlayerPos(chosenplayer,xpos[0]+2,ypos[0]+2,zpos[0]);

				format(string,sizeof(string),"You brought %s to you.",originalplayername[chosenplayer]);
				SendClientMessage(playerid,COLOR_RED,string);
				format(string,sizeof(string),"%s has brought you to him.",originalplayername[playerid]);
				SendClientMessage(chosenplayer,COLOR_RED,string);
				format(string,sizeof(string),"/getin2 %d",playerid);
				OnPlayerCommandText(chosenplayer,string);
			}
		}
tell me what variables you need and i give em to you
if the reg system you use it can save Admin[playerid] then it should be real easy to have this commands on the server
Reply
#9

Quote:
Originally Posted by [SaRp
Ryder ]
here
Код:
if(strcmp(cmd,"/bring",true)==0)
		{
			tmp = strtok(cmdtext,idx);

			if(!strlen(tmp)) {
				SendClientMessage(playerid,0xFFFF00AA,"USAGE: /bring [playerid]");
			}

 if(Admin[playerid] >= 1)

		{

				chosenplayer = strval(tmp);

				GetPlayerPos(playerid,xpos[0],ypos[0],zpos[0]);
				SetPlayerPos(chosenplayer,xpos[0]+2,ypos[0]+2,zpos[0]);

				format(string,sizeof(string),"You brought %s to you.",originalplayername[chosenplayer]);
				SendClientMessage(playerid,COLOR_RED,string);
				format(string,sizeof(string),"%s has brought you to him.",originalplayername[playerid]);
				SendClientMessage(chosenplayer,COLOR_RED,string);
				format(string,sizeof(string),"/getin2 %d",playerid);
				OnPlayerCommandText(chosenplayer,string);
			}
		}
tell me what variables you need and i give em to you
if the reg system you use it can save Admin[playerid] then it should be real easy to have this commands on the server
getting errors :
pawn Код:
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(26) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(28) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(28) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(30) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(34) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(34) : error 017: undefined symbol "Admin"
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(34) : warning 215: expression has no effect
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(34) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(34) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\AdminSystem.pwn(34) : fatal error 107: too many error messages on one line
this
Reply
#10

LOL --> new Admin[MAX_PLAYERS];

the rest cmd and strtok or what it is .. it should already been in your gamemode..that's not part of my variables .. those are just some defines that every gamemode need to have :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)