SA-MP Forums Archive
problem :| - 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: problem :| (/showthread.php?tid=585280)



problem :| - noamch1997 - 12.08.2015

PHP код:
RndSpawn random(sizeof(Derby2s));
                
SetPosEx(playeridDerby2s[RndSpawn][0], Derby2s[RndSpawn][1], Derby2s[RndSpawn][2]);
   
                 new 
FloatA;
            
                
GetPlayerFacingAngle(playeridA);
                
AdminVehicleID[playerid] = AddStaticVehicle(411Derby2s[RndSpawn][0], Derby2s[RndSpawn][1], Derby2s[RndSpawn][2], A00);
                
SetVehicleVirtualWorld(AdminVehicleID[playerid], GetPlayerVirtualWorld(playerid));
                
LinkVehicleToInterior(AdminVehicleID[playerid], GetPlayerInterior(playerid));
                
PutPlayerInVehicle(playeridAdminVehicleID[playerid], 0);
                
UserGameData[playerid][IsInAdminVehicle] = true
Its teleport the player to the position but the player doesnt get the car !..
help me guys
thanks


Re: problem :| - noamch1997 - 12.08.2015

someone ? pls ?


Re: problem :| - jlalt - 12.08.2015

Any warnings on complie?


Re: problem :| - Andre02 - 12.08.2015

Did you create AdminVehicleID somewhere else in your script for example at the start, or before in your code ?
If not add "new" before AdminVehicleID[playerid] = AddStaticVehicle...


Re: problem :| - noamch1997 - 12.08.2015

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Any warnings on complie?
no mate
Quote:
Originally Posted by Andre02
Посмотреть сообщение
Did you create AdminVehicleID somewhere else in your script for example at the start, or before in your code ?
If not add "new" before AdminVehicleID[playerid] = AddStaticVehicle...
I did it bro , look at the code


Re: problem :| - LetsOWN[PL] - 12.08.2015

Quote:
Originally Posted by noamch1997
Посмотреть сообщение
PHP код:
RndSpawn random(sizeof(Derby2s));
                
SetPosEx(playeridDerby2s[RndSpawn][0], Derby2s[RndSpawn][1], Derby2s[RndSpawn][2]);
   
                 new 
FloatA;
            
                
GetPlayerFacingAngle(playeridA);
                
AdminVehicleID[playerid] = AddStaticVehicle(411Derby2s[RndSpawn][0], Derby2s[RndSpawn][1], Derby2s[RndSpawn][2], A00);
                
SetVehicleVirtualWorld(AdminVehicleID[playerid], GetPlayerVirtualWorld(playerid));
                
LinkVehicleToInterior(AdminVehicleID[playerid], GetPlayerInterior(playerid));
                
PutPlayerInVehicle(playeridAdminVehicleID[playerid], 0);
                
UserGameData[playerid][IsInAdminVehicle] = true
Its teleport the player to the position but the player doesnt get the car !..
help me guys
thanks
Hello.
Don't use AddStaticVehicle() - use CreateVehicle() instead.
Quote:
Can only be used when the server first starts (under OnGameModeInit).
From: AddStaticVehicle - SA-MP Wiki.

Greetings.