SA-MP Forums Archive
[HELP] With a Teleport 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)
+--- Thread: [HELP] With a Teleport Command (/showthread.php?tid=612107)



[HELP] With a Teleport Command - Immortal99 - 14.07.2016

I want to make a /sendtosf [playerid] command then i teleport players to Wangs ZCMD


Re: [HELP] With a Teleport Command - IceBilizard - 14.07.2016

PHP код:
CMD:sendtosf(playeridparams[])
{
    new 
givedplayerid,playersname[MAX_PLAYER_NAME],str[60], interiormoneys1;
    if (!
IsPlayerAdmin(playerid)) return 0;//If Player is not rcon admin then show unkown command..
    
if (sscanf(params"u"givedplayerid)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /sendtosf [playerid]");
    if (!
IsPlayerConnected(givedplayerid))    return SendClientMessage(playeridCOLOR_RED"Error: Inactive player id!");
    
GetPlayerName(givedplayeridplayersnamesizeof(playersname));
    
SetPlayerInterior(givedplayerid,0);
    
SetPlayerVirtualWorld(givedplayerid,0);
    if (
GetPlayerState(givedplayerid) == PLAYER_STATE_DRIVER && interior == 0)
    {
        
moneys1 GetPlayerVehicleID(givedplayerid);
        
SetVehiclePos(moneys1, -2075.9360,-77.8931,35.3203);
    }
    else
    {
           
SetPlayerPos(givedplayeridFloat:xFloat:xFloatz);//Set the wange cars coords at x, y ,z
    
}
    
GameTextForPlayer(givedplayerid"Teleported to SF"20000);
    
format(str,sizeof(str),"You have teleported %s to SF.",playersname);
    
SendClientMessage(playerid,-1,str);
    return 
1;