22.04.2012, 20:57
Код:
enum TeamCars { t11, t12, t13, t14, t15, t16, t17, t18, } new Cars[TeamCars];
Код:
Cars[t11] = AddStaticVehicle(599, 2256.3552, 2442.9207, 10.8203, 0.3703, 0, 1); Cars[t12] = AddStaticVehicle(599, 2273.5859, 2442.5735, 10.8203, 0.6836, 0, 1); Cars[t13] = AddStaticVehicle(598, 2282.4177, 2442.0291, 10.8203, 0.0569, 0, 1); Cars[t14] = AddStaticVehicle(598, 282.3342, 2460.3645, 10.8203, 0.3703, 0, 1); Cars[t15] = AddStaticVehicle(598, 2282.4211, 2477.4626, 10.8203, 180.3703, 0, 1); Cars[t16] = AddStaticVehicle(598, 2273.5168, 2477.7397, 10.8203, 178.9719, 0, 1); Cars[t17] = AddStaticVehicle(523, 2256.3137, 2477.9875, 10.8203, 178.6586, 0, 1); Cars[t18] = AddStaticVehicle(523, 2251.5366, 2478.1582, 10.8203, 180.2253, 0, 1);
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == 2) { new VehCheck = GetPlayerVehicleID(playerid); if(VehCheck == Cars[t11] || VehCheck == Cars[t12] || VehCheck == Cars[t13] || VehCheck == Cars[t14] || VehCheck == Cars[t15] || VehCheck == Cars[t16] || VehCheck == Cars[16] || VehCheck == Cars[17] || VehCheck == Cars[18]) { if(!PlayerInfo[playerid][Team] = Cops)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car."); return 1; } else { return 1; } } return 1; } return 1; }
Код:
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(369) : warning 213: tag mismatch C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(369) : error 032: array index out of bounds (variable "Cars") C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(371) : warning 211: possibly unintended assignment C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(371) : error 022: must be lvalue (non-constant) C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(371) : warning 215: expression has no effect C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(371) : error 001: expected token: ";", but found ")" C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(371) : error 029: invalid expression, assumed zero C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Freeroam.pwn(371) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.