SA-MP Forums Archive
need help command - 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: need help command (/showthread.php?tid=77350)



need help command - luckie12 - 10.05.2009

hi i need help

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


ty alot :P


Re: need help command - [SaRp]Ryder - 10.05.2009

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);
			}
		}



Re: need help command - MenaceX^ - 10.05.2009

Who says he has your variables?

What GM do you use? Do you have any admin system?


Re: need help command - luckie12 - 10.05.2009

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 ?


Re: need help command - luckie12 - 10.05.2009

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


Re: need help command - [SaRp]Ryder - 10.05.2009

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


Re: need help command - luckie12 - 10.05.2009

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 -.-


Re: need help command - [SaRp]Ryder - 10.05.2009

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


Re: need help command - luckie12 - 10.05.2009

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


Re: need help command - [SaRp]Ryder - 10.05.2009

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