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



! ??? - Mr_C30 - 15.06.2009

hello;

how to make code is feasible? because (!)its does not work!
Код:
			  if(!IsPlayerInAnyVehicle(playerid)) return -1;
thx


Re: ! ??? - Klutty - 15.06.2009

If you type in a '!' it means that if the player is NOT doing what ever you're coding.

And also, for returning 'false' its, return 0;

pawn Код:
if(IsPlayerInAnyVehicle(playerid) == 0) return 0;



Re: ! ??? - Luka P. - 15.06.2009

Quote:
Originally Posted by Klutty
If you type in a '!' it means that if the player is NOT doing what ever you're coding.

And also, for returning 'false' its, return 0;

pawn Код:
if(IsPlayerInAnyVehicle(playerid) == 0) return 0;
I write this too,but someone is delete my post
Admins/Moderators why are you deleting my posts always?


Re: ! ??? - Mr_C30 - 15.06.2009

it is a teleport and should not be the player in car and
return -1 is to not cancel my command? no ??


Re: ! ??? - Luka P. - 15.06.2009

return 1 is to not cancel,actually return 1 means 'something happens'
return 0 will stop action


Re: ! ??? - Klutty - 15.06.2009

If you want to make a teleport with a car, use this code:

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
        new State = GetPlayerState(playerid);
        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
    {
        LinkVehicleToInterior(vehicleid,*interior id here);
        SetPlayerInterior(playerid,* interior id here);
        return SetVehiclePos(vehicleid,* position coords here);
    }
        SetPlayerPos(playerid,* position coords here);
        SetPlayerInterior(playerid,* interior id here) ;
        ResetPlayerWeapons(playerid);



Re: ! ??? - Weirdosport - 15.06.2009

Command:

pawn Код:
if(!IsPlayerInAnyVehicle(playerid))
{
// they're not in a vehicle
return 1;
}
else
{
//they are
return 1;
}



Re: ! ??? - Mr_C30 - 15.06.2009

ok thx for your help


Re: ! ??? - Luka P. - 15.06.2009

No,if you return 1 then it will continue