[BEGINNER] Whats wrong with this job command?
#8

Quote:
Originally Posted by brokenbottle
Посмотреть сообщение
Oke another question right now
I dont get it with timers! But i want when a player drive in vehicle 420 that they every minute earn $800
But when they leave that vehicle they dont earn anything..
Can anyone help me.? I wanted to figure it out by myself but it doesn't work!
To create a timer do this:
pawn Код:
//On Top
new taxitimer[MAX_PLAYERS];
pawn Код:
if(strcmp("/takejob", cmdtext, true) == 0)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
    {                              
        if(IsPlayerConnected(i))      
        {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 420) return SendClientMessage(playerid, 0xFFFFFFFF, "You cannot work in this vehicle
{
    SendClientMessage(playerid, 0xFFFFFFFF, "
You're now a taxidriver!");
    taxitimer[playerid] = SetTimerEx("taxitimer",60000,true,"i", i);
}
}
    return 1;
}
pawn Код:
//Somewhere in script
foward taxitimer(playerid)
public taxitimer(playerid)
{
  GivePlayerMoney(playerid, 800);
  if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 420)  
{
KillTimer(taxitimer);
}
return 1;
}
I didn't test it, but i think it should work.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)