[Help]Player Can Leave From Vehicles
#1

Hello Guys
Have Smail Problems
Why The Player i kidnap him can out from vehicles??
help +reps
PHP код:
CMD:kidnap(playeridparams[])
{
    new 
targetid;
    if(
sscanf(params,"d",targetid)) return SendClientMessage(playerid0xFF0000FF"USAGE: /kidnap [id]");
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid0xFF0000FF"ERROR: You must be on vehicle!");
    if(
noexit[targetid] == 1noexit[targetid] = 0;
    
noexit[targetid] = 1;
    
PutPlayerInVehicle(targetidGetPlayerVehicleID(playerid), 1);
    new 
rand random(sizeof (NextKidnapp));
    
SetPlayerRaceCheckpoint(playerid2NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.00.00.05.0);
    
SendClientMessage(targetidCOLOR_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/scri...ount.shtml
    
format(Stringsizeof(String), "You kidnapped %s"pName(targetid));
    
GameTextForPlayer(playeridString50004);
    
//for Victim:
    
format(Stringsizeof(String), "You kidnaped From %s"pName(playerid));
    
GameTextForPlayer(targetidString50004);
    
Player_NextKidnapp{playerid} = true;
    
KidnappedPlayerID[playerid] = targetid// store the kidnapped player id in a variable
    
return 1;

Reply
#2

Make sure to place

PHP код:
TogglePlayerControllable(targetid0); 
At the code, and make sure to place this when the kidnapped player is released (/untie or whatever it is).

PHP код:
TogglePlayerControllable(targetid1); 
Reply
#3

What is the code for the kidnapper's victim under OnPlayerExitVehicle?
You should use TogglePlayerControllable as well...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)