Undefined playerid(timer)
#1

Hey,im trying to make a repair command with a timer:
This is my timer.
pawn Код:
forward repairTimer();
public repairTimer()
{
    SendClientMessage(playerid,0xFBFB00FF,"Masina sutvarkyta");
    TogglePlayerControllable(playerid,1);
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
}
And this is the command:
pawn Код:
CMD:repair(playerid,params[])
{
    LoadStats(playerid);
    if(PlayerInfo[playerid][Mechanic] == 1)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(PlayerInfo[playerid][money]>500)
            {
                TogglePlayerControllable(playerid,0);
                GivePlayerMoney(playerid,-500);
                SetTimer("repairTimer",60000,false);
            }
            else return SendClientMessage(playerid,0xFBFB00FF,"Neuztenka pinigu.Kaina:500");
        }
        else return SendClientMessage(playerid,0xFBFB00FF,"Tu turi buti masinoje");
    }
    if(PlayerInfo[playerid][Mechanic]==0) return SendClientMessage(playerid,0xFBFB00FF,"Tu ne mechanikas");
    return 1;
}
Compiling error:
pawn Код:
C:\Users\Justas\Desktop\testserver 0.3x\gamemodes\rp.pwn(440) : error 017: undefined symbol "playerid"
C:\Users\Justas\Desktop\testserver 0.3x\gamemodes\rp.pwn(441) : error 017: undefined symbol "playerid"
C:\Users\Justas\Desktop\testserver 0.3x\gamemodes\rp.pwn(442) : error 017: undefined symbol "playerid"
If i change repairtimer() to repairtimer(playerid), people reported that if one man uses the command,another one gets the answer. Please help
Reply
#2

Quote:
Originally Posted by dusk
Посмотреть сообщение
Hey,im trying to make a repair command with a timer:
This is my timer.
pawn Код:
forward repairTimer(playerid);
public repairTimer(playerid)
{
    SendClientMessage(playerid,0xFBFB00FF,"Masina sutvarkyta");
    TogglePlayerControllable(playerid,1);
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
}
Try that.
Reply
#3

Replace your timer with this
pawn Код:
SetTimerEx("repairTimer",60000,false,"i",playerid);
And then add back playerid to the callback

@Blast3r

Quote:

If i change repairtimer() to repairtimer(playerid), people reported that if one man uses the command,another one gets the answer

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)