[Help]Player Can Leave From Vehicles - 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]Player Can Leave From Vehicles (
/showthread.php?tid=572407)
[Help]Player Can Leave From Vehicles -
astanalol - 27.04.2015
Hello Guys
Have Smail Problems
Why The Player i kidnap him can out from vehicles??
help +reps
PHP код:
CMD:kidnap(playerid, params[])
{
new targetid;
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kidnap [id]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must be on vehicle!");
if(noexit[targetid] == 1) noexit[targetid] = 0;
noexit[targetid] = 1;
PutPlayerInVehicle(targetid, GetPlayerVehicleID(playerid), 1);
new rand = random(sizeof (NextKidnapp));
SetPlayerRaceCheckpoint(playerid, 2, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.0, 0.0, 0.0, 5.0);
SendClientMessage(targetid, COLOR_RED, "You Can Out /cutrope");
new String[19 + MAX_PLAYER_NAME]; // Wouldn't memory feel better if we do this than 128? http://www.javascriptkit.com/script/script2/charcount.shtml
format(String, sizeof(String), "You kidnapped %s", pName(targetid));
GameTextForPlayer(playerid, String, 5000, 4);
//for Victim:
format(String, sizeof(String), "You kidnaped From %s", pName(playerid));
GameTextForPlayer(targetid, String, 5000, 4);
Player_NextKidnapp{playerid} = true;
KidnappedPlayerID[playerid] = targetid; // store the kidnapped player id in a variable
return 1;
}
Re: [Help]Player Can Leave From Vehicles -
JaKe Elite - 27.04.2015
Make sure to place
PHP код:
TogglePlayerControllable(targetid, 0);
At the code, and make sure to place this when the kidnapped player is released (/untie or whatever it is).
PHP код:
TogglePlayerControllable(targetid, 1);
Re: [Help]Player Can Leave From Vehicles -
Mrki_Drakula - 27.04.2015
What is the code for the kidnapper's victim under OnPlayerExitVehicle?
You should use TogglePlayerControllable as well...