21.05.2013, 20:57
At the top of the script:
Made this command, keeps giving me errors.
Код:
new siren1[MAX_VEHICLES]; new siren2[MAX_VEHICLES];
Код:
CMD:siren(playerid, params[]) { new option[5], string[128]; new vid = GetPlayerVehicleID(playerid); if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_GREY, "unauthorized"); if(sscanf(params,"s", option)) return SCM(playerid, COLOR_GREY,"Usage: /siren [dash | roof | off]"); if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_GREY,"You need to be in a vehicle"); { if(!strcmp(option, "dash", true)) { switch (GetVehicleModel(vid)) { case 541://bullet { AttachObjectToVehicle(siren1, vid, 0.000500,0.123000,0.299999,0.000000,0.000000,0.000000); } case 426://premier { AttachObjectToVehicle(siren1, vid, 0.524999,0.749999,0.40000,0.000000,0.000000,0.000000); AttachObjectToVehicle(siren2, vid, 0.000000,-1.50000,0.299999,0.000000,0.000000,0.000000); } case 560://sultan { AttachObjectToVehicle(siren1, vid, 0.524999,0.749999,0.40000,0.000000,0.000000,0.000000); AttachObjectToVehicle(siren2, vid, 0.000000,-1.2500000,0.299999,0.000000,0.000000,0.000000); } case 490://FBI { AttachObjectToVehicle(siren1, vid, 0.000000,1.125000,0.599999,0.000000,0.000000,0.000000); } case 429://banshee { AttachObjectToVehicle(siren1, vid, 0.000500,0.123000,0.299999,0.000000,0.000000,0.000000); } case 489://rancher { AttachObjectToVehicle(siren1, vid, 0.000000,1.125000,0.599999,0.000000,0.000000,0.000000); } case 495://sand dune { AttachObjectToVehicle(siren1, vid, 0.005000,0.125000,1.000500,0.000000,0.000000,0.000000); } case 579://huntlye { AttachObjectToVehicle(siren1, vid, 0.000000,1.125000,0.599999,0.000000,0.000000,0.000000); } case 415://cheetah { AttachObjectToVehicle(siren1, vid, 0.120500,0.000000,0.605000,0.000000,0.000000,0.000000); } case 420://taxi { AttachObjectToVehicle(siren1, vid, 0.524999,0.749999,0.40000,0.000000,0.000000,0.000000); AttachObjectToVehicle(siren2, vid, 0.000000,-1.00000,0.299999,0.000000,0.000000,0.000000); } case 554://yosemite { AttachObjectToVehicle(siren1, vid, 0.000000,1.125000,0.599999,0.000000,0.000000,0.000000); } case 576://tornado { AttachObjectToVehicle(siren1, vid, 0.524999,0.749999,0.40000,0.000000,0.000000,0.000000); } case 533://premier { AttachObjectToVehicle(siren1, vid, 0.524999,0.749999,0.40000,0.000000,0.000000,0.000000); AttachObjectToVehicle(siren2, vid, 0.000000,-1.50000,0.299999,0.000000,0.000000,0.000000); } case 402://buffalo { AttachObjectToVehicle(siren1, vid, 0.000500,0.123000,0.299999,0.000000,0.000000,0.000000); } default: { return SendClientMessage(playerid, 0xAFAFAFFF, "Vehicle doesn't support that slot!"); } } } if(!strcmp(option, "roof", true)) { switch (GetVehicleModel(vid)) { case 541://bullet { AttachObjectToVehicle(siren2, vid, -0.010000,0.125000,0.500000,0.000000,0.000000,0.000000); } case 426://premier { AttachObjectToVehicle(siren2, vid, -0.010000,0.125000,0.500000,0.000000,0.000000,0.000000); } case 560://sultan { AttachObjectToVehicle(siren2, vid, -0.010000,0.125000,0.500000,0.000000,0.000000,0.000000); } case 490://FBI { AttachObjectToVehicle(siren2, vid, 0.005000,0.125000,1.000500,0.000000,0.000000,0.000000); } case 482://burrito { AttachObjectToVehicle(siren1, vid, 0.175000,0.500000,1.000000,0.000000,0.000000,0.000000); } case 489://rancher { AttachObjectToVehicle(siren2, vid, 0.005000,0.125000,1.000500,0.000000,0.000000,0.000000); } case 495://sand dune { AttachObjectToVehicle(siren2, vid, 0.005000,0.125000,1.000500,0.000000,0.000000,0.000000); } case 579://huntlye { AttachObjectToVehicle(siren2, vid, 0.005000,0.125000,1.250000,0.000000,0.000000,0.000000); } case 415://cheetah { AttachObjectToVehicle(siren1, vid, 0.120500,0.000000,0.200000,0.000000,0.000000,0.000000); } case 554://yosemite { AttachObjectToVehicle(siren2, vid, 0.0000,0.100000,1.000000,0.000000,0.000000,0.000000); } case 576://tornado { AttachObjectToVehicle(siren1, vid, 0.005000,0.125000,1.000000,0.000000,0.000000,0.000000); } case 470://patir { AttachObjectToVehicle(siren2, vid, 0.005000,0.125000,1.000500,0.000000,0.000000,0.000000); } case 402://buffalo { AttachObjectToVehicle(siren2, vid, 0.00000,-0.5000,0.700000,0.000000,0.000000,0.000000); } default: { return SendClientMessage(playerid, 0xAFAFAFFF, "Vehicle doesn't support that slot!"); } } } if(!strcmp(option, "off", true)) { DestroyObject(siren1) DestroyObject(siren2) } } return 1; }
Код:
C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3732) : error 033: array must be indexed (variable "siren1") C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3733) : error 033: array must be indexed (variable "siren2") C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3734) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3738) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3739) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3743) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3744) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3748) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3752) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3757) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3761) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3765) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3769) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3773) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3774) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3778) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3782) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3786) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3787) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3791) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3805) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3809) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3813) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3817) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3821) : error 035: argument type mismatch (argument 1) C:\Users\Scoot\Desktop\Roleplay\gamemodes\rp.pwn(3825) : error 035: argument type mismatch (argument 1) Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 26 Errors.