PDA

View Full Version : How can I?


Affan
11/06/2013, 04:44 AM
How can I make this command do /goto Criss 0 0 5
Which makes me teleport to Criss and go up.

COMMAND:goto(playerid, params[])
{
if(!strlen(params)) return SendClientMessage(playerid,COLOR_RED,""COL_RED"[S]: "COL_WHITE"Usage:/goto <id/nick>.");
new id;
if(!IsNumeric(params)) id = ReturnPlayerID(params);
else id = strval(params);
if(turngoto[id] == 1)
{
SendClientMessage (playerid, 0xFFFFFFFF, ""COL_RED"[S]: "COL_WHITE"This player has goto "COL_RED"DISABLED. ");
}
else if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID) {
new string[256],PlayerName[24],ActionName[24],Float:X,Float:Y,Float:Z; GetPlayerName(playerid,PlayerName,24); GetPlayerName(id,ActionName,24);
new Interior = GetPlayerInterior(id); SetPlayerInterior(playerid,Interior); SetPlayerVirtualWorld(playerid,GetPlayerVirtualWor ld(id)); GetPlayerPos(id,X,Y,Z); if(IsPlayerInAnyVehicle(playerid)) { SetVehiclePos(GetPlayerVehicleID(playerid),X+ 0.0,Y + -5.0,Z+ 0.0); LinkVehicleToInterior(GetPlayerVehicleID(playerid) ,Interior); } else SetPlayerPos(playerid,X+ 0.0,Y+ -5.0,Z + 0.0);
format(string,256,""COL_BLUE"[S]: "COL_YELLOW"%s has teleported to your location.",PlayerName); SendClientMessage(id,COLOR_WHITE,string);
format(string,256,""COL_BLUE"[S]: "COL_YELLOW"You have teleported to %s's location.",ActionName); return SendClientMessage(playerid,COLOR_YELLOW,string);
} else return SendClientMessage(playerid,COLOR_WHITE,""COL_RED"[S]: Invalid player ID.");
return 1;
}