16.09.2012, 00:36
Hi please i need help i want to make a simple cmd that you can use to teleport to cordinates like [x y z cords].
can someone help me with this please!!
can someone help me with this please!!
if(strcmp(cmdtext, "/teleport", true) == 0)
{
SetPlayerPos(playerid, X, Y, Z); //Replace X, Y and Z with your coords.
return 1;
}
CMD:teleport(playerid,params[])
{
SetPlayerPos(playerid, X, Y, Z); //Replace X, Y and Z with your coords.
return 1;
}
CMD:tp(playerid, params[])
{
new int, Float: x, Float: y, Float: z;
if(sscanf(params, "dfff", int, x, y, z))
return SendClientMessage(playerid, GREY, "SYNTAX: /tp [int] [x] [y] [z]");
SetPlayerPos(playerid, x, y, z);
SetPlayerInterior(playerid, int);
return SendClientMessage(playerid, -1, "Teleport successful.");;
}
if(IsPlayerInAnyVehicle(playerid)) //if player is in vehicle
{
SetPlayerVehiclePos(GetPlayerVehicleID(playerid), x, y, z); //change the x, y, z to your coordinate
SetPlayerVehicleZAngle(GetPlayerVehicleID(playerid), ang); //change the ang to your coordinate
LinkVehicleToInterior(GetPlayerVehicleID(playerid), int);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), world);
}
else //if player is onfoot
{
SetPlayerPos(playerid, x, y, z); //change the x, y, z to your coordinate
SetPlayerFacingAngle(playerid, ang); //change the ang to your coordinate
}
pawn Код:
|
CMD:tp(playerid, params[])
{
new int, Float: x, Float: y, Float: z;
if(sscanf(params, "dfff", int, x, y, z)) return SendClientMessage(playerid, -1, "SYNTAX: /tp [int] [x] [y] [z]");
SetPlayerPos(playerid, x, y, z);
SetPlayerInterior(playerid, int);
SendClientMessage(playerid, -1, "Teleport successful.");
return 1;
}
hi i got this errors when i compiled
C:\Users\YOUNG MONEY\Desktop\SAMP scripts\1\Newport City Roleplay\gamemodes\EG-RP.pwn(35725) : warning 217: loose indentation C:\Users\YOUNG MONEY\Desktop\SAMP scripts\1\Newport City Roleplay\gamemodes\EG-RP.pwn(35725) : error 029: invalid expression, assumed zero C:\Users\YOUNG MONEY\Desktop\SAMP scripts\1\Newport City Roleplay\gamemodes\EG-RP.pwn(35725) : error 017: undefined symbol "cmd_tp" C:\Users\YOUNG MONEY\Desktop\SAMP scripts\1\Newport City Roleplay\gamemodes\EG-RP.pwn(35725) : error 029: invalid expression, assumed zero C:\Users\YOUNG MONEY\Desktop\SAMP scripts\1\Newport City Roleplay\gamemodes\EG-RP.pwn(35725) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
CMD:teleport(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
SetPlayerVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
}
else
{
SetPlayerPos(playerid, x, y, z);
}
return 1;
}