remove player to his vihilce - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: remove player to his vihilce (
/showthread.php?tid=109711)
remove player to his vihilce -
a-day - 21.11.2009
hello everybody i have the problem that when iґam on a huge map and iam in a car i cant see the objects i can see them first when i get out of the car so i want to script something that removes the player from his car and put the player back again in his car but i have a problem the player removes but he dont go back in his car ?
i have use this here
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
SetTimerEx("PutOn", 1000, false, "ii", playerid, vehicleid);
return 1;
}
forward PutOn(playerid, vehicleid);
public PutOn(playerid, vehicleid)
{
PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}
and i have put this in my command
Код:
new gVeh = GetPlayerVehicleID(playerid);
RemovePlayerFromVehicle(playerid);
OnPlayerExitVehicle(playerid, gVeh);
but it dont works

can somebody help me please ?
Re: remove player to his vihilce -
d0 - 21.11.2009
This in your Command:
Код:
RemovePlayerFromVehicle(playerid);
SetTimerEx("PutOn", 1000, false, "dd", playerid, GetPlayerVehicleID(playerid));
and
Код:
forward PutOn(playerid, vehicleid);
public PutOn(playerid, vehicleid)
{
PutPlayerInVehicle(playerid, vehicleid, 0);
return 1;
}
Re: remove player to his vihilce -
a-day - 21.11.2009
hmm ok i have test it but it dont works again
the player get out of his car but he dont join in
this is the command
Код:
if(strcmp(cmdtext, "/sos", true) == 0)
{
if(derbygodupfuck[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Du bist im Derby zum verlassen tippe /derbyex");
if(DMZone[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Du bist im DM Modus zum verlassen tippe /dmex");
RemovePlayerFromVehicle(playerid);
SetTimerEx("PutOn", 1000, false, "dd", playerid, GetPlayerVehicleID(playerid));
new name[MAX_PLAYER_NAME];
new string[100];
new cartype=GetPlayerVehicleID(playerid);
GetPlayerName(playerid, name, sizeof(name));
SetPlayerInterior(playerid,0);
format(string, sizeof(string), ">>> %s Schreit nach Hilfe bei sos /sos <<<", name);
SendClientMessageToAll(0x0EA2DFF, string);
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), 215.991562, -1473.438721, 4531.075195);
SetVehicleZAngle(cartype,271.6777);
}
else
{
SetPlayerPos(playerid, 215.991562, -1473.438721, 4531.075195);
}
return 1;
}
EDIT:
ok it works

the timer was only a little bit to fast so there was any reaction because i was over the timer
i made it a littble bit slower from 1000 to 2500
thx doerfler