Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.2 kB
2
Indexable
Never
hook OnPlayerEnterCheckpoint(playerid) {
	if(GetPVarInt(playerid, "GarbageJob") > 0) {
		if(IsPlayerInRangeOfPoint(playerid, 3.0, Float:x, Float:y, Float:z)) {
			TogglePlayerControllable(playerid, 0);

			SendClientMessageEx(playerid, -1, "Ban da bat dau do rac.");

			SetPVarInt(playerid, "DoRacTime", 10);
			SetTimerEx("DoRacNe", 1000, 0, "d", playerid);
			return 1;
		}
	}
	return 1;
}

forward DoRacNe(playerid);
public DoRacNe(playerid)
{
    SetPVarInt(playerid, "DoRacTime", GetPVarInt(playerid, "DoRacTime")-1);

    new string[1280];
    new zone[MAX_ZONE_NAME];
    format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~%d giay con lai", GetPVarInt(playerid, "DoRacTime"));
    GameTextForPlayer(playerid, string, 1100, 3);
    if(GetPVarInt(playerid, "DoRacTime") > 0) SetTimerEx("DoRacNe", 1000, 0, "d", playerid);
    if(GetPVarInt(playerid, "DoRacTime") <= 0)
    {
        DeletePVar(playerid, "DoRacTime");
        DeletePVar(playerid, "DoRacNe");
        
        SendClientMessageEx(playerid, -1, "Ban da do rac thanh cong");
        SetVehicleToRespawn(GetPlayerVehicleID(playerid));

		TogglePlayerControllable(playerid, 1);
		return 1;
    }
	return 1;
}