Teleport with car help me !
#1

Hey i wanna teleport to home with a car but if i type /home then car dont comes .. -.- code is there .
PHP код:

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
 print(
"\n--------------------------------------");
 print(
" Simple city teleporter by fahadtariq73");
 print(
"--------------------------------------\n");
 return 
1;
}
public 
OnFilterScriptExit()
{
 return 
1;
}
#else
main()
{
 print(
"\n----------------------------------");
 print(
" Blank Gamemode by your name here");
 print(
"----------------------------------\n");
}
#endif
public OnGameModeInit()
{
     
// Don't use these lines if it's a filterscript
     
SetGameModeText("Blank Script");
     
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
     return 
1;
}
public 
OnGameModeExit()
{
 return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
 
SetPlayerPos(playerid1958.37831343.157215.3746);
 
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
 
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
 return 
1;
}
public 
OnPlayerConnect(playerid)
{
 return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
 return 
1;
}
public 
OnPlayerSpawn(playerid)
{
 return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
 return 
1;
}
public 
OnVehicleSpawn(vehicleid)
{
 return 
1;
}
public 
OnVehicleDeath(vehicleidkillerid)
{
 return 
1;
}
public 
OnPlayerText(playeridtext[])
{
 return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
     if (
strcmp("/ls"cmdtexttrue10) == 0)
     {
         
SetPlayerPos(playerid,2492.8408,-1671.2026,13);
          return 
1;
 }
     if (
strcmp("/lv"cmdtexttrue10) == 0)
 {
        
SetPlayerPos(playerid,1454.9015,1347.4325,10);
          return 
1;
 }
     if (
strcmp("/sf"cmdtexttrue10) == 0)
 {
        
SetPlayerPos(playerid,-1320.2717,-603.5780,14);
        
        
        
        return 
1;
 }
          
    if (
strcmp("/home"cmdtexttrue10) == 0// need with car to teleport homee
 
{
        
SetPlayerPos(playerid,423.2374,2498.1079,16.2378);
        
        
          
        return 
1;
          
          
          
          
          
 }
     return 
0;
}
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
 return 
1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
 return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
 return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
 return 
1;
}
public 
OnPlayerLeaveCheckpoint(playerid)
{
 return 
1;
}
public 
OnPlayerEnterRaceCheckpoint(playerid)
{
 return 
1;
}
public 
OnPlayerLeaveRaceCheckpoint(playerid)
{
 return 
1;
}
public 
OnRconCommand(cmd[])
{
 return 
1;
}
public 
OnPlayerRequestSpawn(playerid)
{
 return 
1;
}
public 
OnObjectMoved(objectid)
{
 return 
1;
}
public 
OnPlayerObjectMoved(playeridobjectid)
{
 return 
1;
}
public 
OnPlayerPickUpPickup(playeridpickupid)
{
 return 
1;
}
public 
OnVehicleMod(playeridvehicleidcomponentid)
{
 return 
1;
}
public 
OnVehiclePaintjob(playeridvehicleidpaintjobid)
{
 return 
1;
}
public 
OnVehicleRespray(playeridvehicleidcolor1color2)
{
 return 
1;
}
public 
OnPlayerSelectedMenuRow(playeridrow)
{
 return 
1;
}
public 
OnPlayerExitedMenu(playerid)
{
 return 
1;
}
public 
OnPlayerInteriorChange(playeridnewinterioridoldinteriorid)
{
 return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
 return 
1;
}
public 
OnRconLoginAttempt(ip[], password[], success)
{
 return 
1;
}
public 
OnPlayerUpdate(playerid)
{
 return 
1;
}
public 
OnPlayerStreamIn(playeridforplayerid)
{
 return 
1;
}
public 
OnPlayerStreamOut(playeridforplayerid)
{
 return 
1;
}
public 
OnVehicleStreamIn(vehicleidforplayerid)
{
 return 
1;
}
public 
OnVehicleStreamOut(vehicleidforplayerid)
{
 return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
 return 
1;
}
public 
OnPlayerClickPlayer(playeridclickedplayeridsource)
{
 return 
1;

Reply
#2

PHP код:
if(strcmp("/home"cmdtexttrue10) == 0// need with car to teleport homee
{
    if(
GetPlayerState(playerid) == 2) {
        
SetVehiclePos(GetPlayerVehicleID(playerid),423.2374,2498.1079,16.2378);
    } else {
        
SetPlayerPos(playerid,423.2374,2498.1079,16.2378);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)