SA-MP Forums Archive
Undefined playerid(timer) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Undefined playerid(timer) (/showthread.php?tid=415688)



Undefined playerid(timer) - dusk - 14.02.2013

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


Re: Undefined playerid(timer) - Blast3r - 14.02.2013

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.


Re: Undefined playerid(timer) - InfiniTy. - 14.02.2013

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