/goto... - 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: /goto... (
/showthread.php?tid=164227)
/goto... -
Sir_bomber - 30.07.2010
Hay, Im trying to find a /goto cmd (tele player to player) but all the cmds I find is admin cmds... I dont want it to be admin cmd... Can anyone help me? :S
Re: /goto... -
ViruZZzZ_ChiLLL - 30.07.2010
Here try this :
pawn Код:
CMD:goto(playerid, params[])
{
new Float:x, Float:y, Float:z;
new playerid2;
if(sscanf(params, "u", playerid2))
{
SendClientMessage(playerid, Orange, "USAGE : /goto [playerid]");
SendClientMessage(playerid, Lightblue, "FUNCTION : Goto a particular players position");
}
else if(playerid2 == INVALID_PLAYER_ID) SendClientMessage(playerid, Red, "ERROR : That player is not connected!");
else if(playerid2 == playerid) SendClientMessage(playerid, Red, "ERROR : You cant go to yourself!");
else
{
GetPlayerPos(playerid2, x, y, z);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(playerid2));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(playerid2));
SetVehiclePos(GetPlayerVehicleID(playerid), x+2, y,z);
SetVehicleZAngle(GetPlayerVehicleID(playerid),0.0);
}
else
{
SetPlayerPos(playerid, x+2, y, z);
SetPlayerInterior(playerid, GetPlayerInterior(playerid2));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerid2));
}
}
return 1;
}
I used sscanf + zcmd.
Re: /goto... -
Code_Red - 30.07.2010
use that^^^
and note to the future:
if you want to remove the admin thing just find the if(something about admin) and delete it
Re: /goto... -
Sir_bomber - 30.07.2010
Код:
C:\Documents and Settings\ben\Desktop\junk\Server\filterscripts\cmds.pwn(350) : error 029: invalid expression, assumed zero
C:\Documents and Settings\ben\Desktop\junk\Server\filterscripts\cmds.pwn(350) : error 017: undefined symbol "cmd_goto"
C:\Documents and Settings\ben\Desktop\junk\Server\filterscripts\cmds.pwn(350) : error 029: invalid expression, assumed zero
C:\Documents and Settings\ben\Desktop\junk\Server\filterscripts\cmds.pwn(350) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Well... :S
Re: /goto... -
Vince - 30.07.2010
Get zcmd. If you don't know what that is, you might as well stop scripting now.
Re: /goto... -
Sir_bomber - 30.07.2010
I added #include <zcmd>... AND I have the zcmd.inc file in Pawno/inlude...
Re: /goto... -
Daren_Jacobson - 30.07.2010
Quote:
Originally Posted by Vince
Get zcmd. If you don't know what that is, you might as well stop scripting now.
|
why zcmd? zcmd isn't much better than dcmd or just strcmp, he can script just fine without zcmd, but I would recommend getting it.
Re: /goto... -
Sir_bomber - 30.07.2010
Well.... Can anyone make something then?
Re: /goto... -
John_F - 30.07.2010
Well, the code is there. I think you put cmd_goto instead of CMD:goto
try changing it.
Re: /goto... -
Kar - 30.07.2010
no if anything like that gets called the compiler calls it as cmd_ like try putting 2 cmds with the same function/name
in the compiler it will say cmd_goto already defined
also daren zcmd is much better than dcmd+ strcmp.