28.12.2009, 13:22
Hey i use Ladmin 4v2 and i made /car command so all can use it, now i wanted to make a /acar command that only works for admins and, success! Admins can now spawn how many cars they want. But, my friend asked if i could make a 5 minute timer, and theres the problem.
Heres my code:
And heres the error:
Heres my code:
Код:
4336dcmd_acar(playerid,params[]){ 4337 if(PlayerInfo[playerid][Level] >= 5 && PlayerInfo[playerid][LoggedIn] == 1) { 4338 new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index); 4339 if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /acar [VehicleID/VehicleName] [colour1] [colour2]"); 4340 new car, colour1, colour2; 4341 if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp); 4342 if(car < 400 || car > 611) return SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model"); 4343 if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2); 4344 if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3); 4345 new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z);4346 GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid); 4347 LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1); 4348 PlayerInfo[playerid][pCar] = LVehicleID; 4349 SetTimer(CarDeleter,300000,1); 4350 } else return SendClientMessage(playerid,red,"You are not high enough level to use this command!"); 4351 return 1; 4352}
Код:
C:\Documents and Settings\Administrator\Desktop\Server\filterscripts\ladmin.pwn(4349) : error 076: syntax error in the expression, or invalid function call Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.