How to check if player is in car
#1

How do i check to see if the idis in a car,
It already checks to see if the player is connected,
And also sends a usage...
But how to check if the guy who said the command and the guy he is cuffing,
are in a copcar? I know how but its already checking for player connected and sendin a usage,

pawn Code:
new index;
new cmd[20];
cmd = strtok(cmdtext, index);
if (strcmp(cmd, "/cuff", true) == 0)
{
new tmp[20];
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SendClientMessage(id, 0xFFFFFFFFF, "You have been cuffed and cannot move");
TogglePlayerControllable(id,0);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "[Usage]: /cuff [playerid/name]");
}
return 1;
}
Reply
#2

Is this what u looking for ?

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {

if(IsPlayerInAnyVehicle(playerid)) {
Reply
#3

Yes but im not sure where to add it without it getting confused with PlayerConnected n Usage
Reply
#4

i sended u a pastebin by pm.
Reply
#5

Quote:
Originally Posted by wijnkamp
hold on i send you a pastebin how i got it..!
Er... Kk
Reply
#6

Don't do it in PM's, you can help others if you just post it here
Reply
#7

^^

Sorry if i'm insult you but are you blind?
This topic is made since 2009..

Bumping it?
Reply
#8

PHP Code:

else
{
if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000AA"Playeris in vehicle so cant be cuffed.");

You mean this ? If so add this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)