27.08.2012, 20:39
Here's the cmd, and and below it's the errors. Having huge trouble on it, and wondering what i'm doing wrong. If someone can tell me how to fix them, that'd be great.
Errors:
C:\Users\Jay\Desktop\New Nation Roleplay\gamemodes\NNRP.pwn(27062) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jay\Desktop\New Nation Roleplay\gamemodes\NNRP.pwn(27062) : error 017: undefined symbol "vehicle"
C:\Users\Jay\Desktop\New Nation Roleplay\gamemodes\NNRP.pwn(27075) : error 017: undefined symbol "objectid"
Код:
if(strcmp(cmd, "/coplights", true) == 0) new vehicle = GetPlayerVehicleID(playerid); if(IsPlayerInAnyVehicle(playerid)) { if(Coplights[playerid] == 0) { new objectid = CreateObject(19419, 0, 0, 0, 0, 0, 0); AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.944999, 0.000000, 0.000000, 0.000000); //Object Model: 19419 format(string, sizeof(string), "%s has attached coplights to their car.", sendername); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); Coplights[playerid] = 1; } else { DestroyObject(objectid, GetPlayerVehicleID(playerid)); format(string, sizeof(string), "%s has removed the coplights from their car.", sendername); ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); Coplights[playerid] = 0; } return 1; }
C:\Users\Jay\Desktop\New Nation Roleplay\gamemodes\NNRP.pwn(27062) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jay\Desktop\New Nation Roleplay\gamemodes\NNRP.pwn(27062) : error 017: undefined symbol "vehicle"
C:\Users\Jay\Desktop\New Nation Roleplay\gamemodes\NNRP.pwn(27075) : error 017: undefined symbol "objectid"