04.09.2015, 11:42
Код:
CMD:seatbelt(playerid, params[]) { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) return SendErrorMessage(playerid, "You are not in any vehicle."); new string[50 + MAX_PLAYER_NAME]; if(IsPlayerInAnyVehicle(playerid) == 1 && Seatbelt[playerid] == 0) { Seatbelt[playerid] = 1; if(IsABike(GetPlayerVehicleID(playerid))) { format(string, sizeof(string), "* %s reaches for their helmet, and puts it on.", ReturnName(playerid, 0)); SetPlayerAttachedObject(playerid, 2, 18645, 2, 0.07, 0, 0, 88, 75, 0); } else { format(string, sizeof(string), "* %s reaches for their seatbelt, and buckles it up.", ReturnName(playerid, 0)); //SetPlayerAttachedObject(playerid, 2, 18634, 7,0.000000, 0.100000, 0.350000, -35.224993, 45.215000, 1.500000, 5.000000, 1.500000, 1.500000); } } else if(IsPlayerInAnyVehicle(playerid) == 1 && Seatbelt[playerid] == 1) { Seatbelt[playerid] = 0; if(IsABike(GetPlayerVehicleID(playerid))) { format(string, sizeof(string), "* %s reaches for their helmet, and takes it off.", ReturnName(playerid, 0)); RemovePlayerAttachedObject(playerid, 2); } else { format(string, sizeof(string), "* %s reaches for their seatbelt, and unbuckles it.", ReturnName(playerid, 0)); // RemovePlayerAttachedObject(playerid, 2); } } SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "%s", string); return 1; }
How can i turn this command into check belt to see if a player has there belt on or not?