08.01.2015, 20:28
Wow thank you so much but i wanted to ask one more thing
Same problem with dropcar :/
As this is different type code i am facing the same problem again :/
All about the timer itself:
CMD and OnPlayerEnterCP
Same problem with dropcar :/
As this is different type code i am facing the same problem again :/
All about the timer itself:
PHP код:
PlayerInfo[playerid][pCountDown] = 0;
dini_IntSet(file, "CountDown", PlayerInfo[playerid][pCountDown]);
PlayerInfo[playerid][pCountDown] = dini_Int(file, "CountDown");
forward CountDown(playerid);
public CountDown(playerid)
{
g_var[playerid] = 0;
}
CMD and OnPlayerEnterCP
PHP код:
CMD:dropcar(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(g_var[playerid] == 1) return SendClientMessage(playerid,COLOR_GREY,"**You need to wait 20 minutes to use this command again.");
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "**You need to login first before using any command.");
if(!vehicleid) return SendClientMessage(playerid, COLOR_GREY, "**You must be inside a vehicle to use this command.");
if(GetPlayerVehicleID(playerid) != 0)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 2789.6619, -2517.8105, 16.1509, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Deliver car to the Los Santos docks to recive your pay!");
if(PointInfo[4][pOwner])
{
new idx = PointInfo[4][pOwner];
FamInfo[idx][fMoney] += 1*2;
PointInfo[4][pProfit] += 1*2;
}
}
return 1;
}
PHP код:
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!vehicleid) return SendClientMessage(playerid, COLOR_GREY, "**You must be inside a vehicle.");
if(g_var[playerid] == 0 && IsPlayerInRangeOfPoint(playerid, 5, 2789.6619, -2517.8105, 16.1509))
{
DisablePlayerCheckpoint(playerid);
new string[128], amount;
amount = 100+random(250);
format(string, sizeof(string), "*You've earned {FF6347}$%d{33CCFF} from dropping a car!", amount);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GiveDodMoney(playerid, amount);
SetVehicleToRespawn(vehicleid);
g_var[playerid] = 1;
SetTimerEx("CountDown",1200*1000, false, "d", playerid);
}