#1

hello;

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

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;
Reply
#3

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?
Reply
#4

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

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

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);
Reply
#7

Command:

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

ok thx for your help
Reply
#9

No,if you return 1 then it will continue
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)