28.11.2011, 07:57
Hey.. I made myself a seatbelt command, and I'm trying to do that if the player exit the vehicle and the seatbelt still on him he wont be able to leave, it means he'll stay in the vehicle till he take it off...
any help how can I do it?
btw.. here's my seatbelt command..
any help how can I do it?
btw.. here's my seatbelt command..
pawn Код:
new seatbelt[MAX_PLAYERS];
if(!strcmp(cmd, "/seatbelt", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(seatbelt[playerid] == 0)
{
seatbelt[playerid] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Puts on him the seat belt, and a seat belt buckle.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if(seatbelt[playerid] == 1)
{
seatbelt[playerid] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Unbuckle the seat belt.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}