SetTimer("GateTimer", 3000, true);
public OnGameModeInit() {
public GateTimer(playerid) { if(playerDB[playerid][specialybe]==1 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1631.78, 688.24, 8.6)) { MoveObject(SFPDshutter, -1631.78, 688.24, 14.68,2); } if(playerDB[playerid][specialybe]==1 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1641.391602, 680.608826, 8.073167)) { MoveObject(SFPDgate, -1641.385742, 687.582703, 8.124618,2); } if(playerDB[playerid][specialybe]==1 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1571.862183, 663.180664, 7.998168)) { MoveObject(SFPDgate1, -1571.873047, 668.873352, 7.974930,2); } if(playerDB[playerid][vip] || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -2079.0961914063, 1366.5452880859, 8.8740577697754)) { MoveObject(vipv, -2079.0961914063, 1366.5452880859, 0.8740577697754,3); } if(playerDB[playerid][specialybe]==52 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -2433.755859375, 496.25634765625, 31.701829910278)) { MoveObject(apv, -2433.755859375, 496.25634765625, 23.701829910278,3); } if(playerDB[playerid][specialybe]==10 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1039.1740722656, -586.90856933594, 33.781204223633)) { MoveObject(armijav, -1039.1740722656, -586.90856933594, 25.781204223633,2); } if(playerDB[playerid][specialybe]==56 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -715.131,969.447,13.914)) { MoveObject(zydrag, -715.127,969.430,8.109,2); } if(playerDB[playerid][specialybe]==55 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -2486.223,-614.577,134.288)) { MoveObject(ballas, -2486.223,-614.573,128.361,2); } if(playerDB[playerid][specialybe]==10 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1531.3148193359, 482.1376953125, 8.9608917236328)) { MoveObject(fbiv, -1531.3148193359, 482.1376953125, 0.9608917236328,2); } return 1; }
public GateTimer() { for(new playerid;playerid<MAX_PLAYERS;playerid++) { if(playerDB[playerid][specialybe]==1 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1631.78, 688.24, 8.6)) { MoveObject(SFPDshutter, -1631.78, 688.24, 14.68,2); } if(playerDB[playerid][specialybe]==1 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1641.391602, 680.608826, 8.073167)) { MoveObject(SFPDgate, -1641.385742, 687.582703, 8.124618,2); } if(playerDB[playerid][specialybe]==1 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1571.862183, 663.180664, 7.998168)) { MoveObject(SFPDgate1, -1571.873047, 668.873352, 7.974930,2); } if(playerDB[playerid][vip] || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -2079.0961914063, 1366.5452880859, 8.8740577697754)) { MoveObject(vipv, -2079.0961914063, 1366.5452880859, 0.8740577697754,3); } if(playerDB[playerid][specialybe]==52 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -2433.755859375, 496.25634765625, 31.701829910278)) { MoveObject(apv, -2433.755859375, 496.25634765625, 23.701829910278,3); } if(playerDB[playerid][specialybe]==10 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1039.1740722656, -586.90856933594, 33.781204223633)) { MoveObject(armijav, -1039.1740722656, -586.90856933594, 25.781204223633,2); } if(playerDB[playerid][specialybe]==56 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -715.131,969.447,13.914)) { MoveObject(zydrag, -715.127,969.430,8.109,2); } if(playerDB[playerid][specialybe]==55 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -2486.223,-614.577,134.288)) { MoveObject(ballas, -2486.223,-614.573,128.361,2); } if(playerDB[playerid][specialybe]==10 || playerDB[playerid][admin]) if(IsPlayerInRangeOfPoint(playerid, 15, -1531.3148193359, 482.1376953125, 8.9608917236328)) { MoveObject(fbiv, -1531.3148193359, 482.1376953125, 0.9608917236328,2); } } return 1; }
SetTimerEx("GateTimer", 3000, true, "i", playerid);
Yes, SetTimerEx works for playerid, and SetTimer works only for ID 0
so : pawn Код:
|
data/init.txt(472) : error 017: undefined symbol "playerid"
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SetTimerEx("GateTimer", 3000, true, "i", playerid);
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) // Replace 20 with the desired range. Replace x, y, z with the coordinates of your gate.
{
SetTimerEx("GateTimer", 3000, true, "i", playerid);
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) else if(IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) else if(IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) else if(IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) { SetTimerEx("GateTimer", 3000, true, "i", playerid); return 1; }