Olha eu aqui de novo,cansei de quebrar a cabeça e vim pedir ajuda ;)
Não ta salvando tuning,ele cria o arquivo mais não salva
fica assim:
FS \/
Não ta salvando tuning,ele cria o arquivo mais não salva
fica assim:
Quote:
mod1=0 mod2=0 mod3=0 mod4=0 mod5=0 mod6=0 mod7=0 mod9=0 mod10=0 mod11=0 mod12=0 mod13=0 mod14=0 mod15=0 mod16=0 mod17=0 paintjob=0 color1=0 color2=0 |
Quote:
#include <a_samp> #include <a_players> #include <dini> #define FILTERSCRIPT #if defined FILTERSCRIPT //================================================== ==== Dialogs =========================================== #define loja 1621 #define Xenon 1622 #define Neon 1623 #define Paintjob 1624 // new Xenons[8]; //================================================== === Cores =============================================== #define BRANCO 0xFFFFFFFF #define AMARELO 0xFFCC00FF #define VERMELHO 0xFF0000FF #define VERDE 0x2AC40000 #define AZUL 0x375FFFFF //================================================== = CallBacks =============================================== //menu salvar tun forward TuneThisCar(vehicleid); forward LoadModsForAll(vehicleid); forward SaveModsForAll(vehicleid); forward VehicleSpawn (vehicleid); forward RestartVeh(vehicleid); forward Timermods(); //================================================== = Sistema de salvar tuning new spoiler[20][0] = { {1000}, {1001}, {1002}, {1003}, {1014}, {1015}, {1016}, {1023}, {1058}, {1060}, {1049}, {1050}, {1138}, {1139}, {1146}, {1147}, {1158}, {1162}, {1163}, {1164} }; new nitro[3][0] = { {1008}, {1009}, {1010} }; new fbumper[23][0] = { {1117}, {1152}, {1153}, {1155}, {1157}, {1160}, {1165}, {1167}, {1169}, {1170}, {1171}, {1172}, {1173}, {1174}, {1175}, {1179}, {1181}, {1182}, {1185}, {1188}, {1189}, {1192}, {1193} }; new rbumper[22][0] = { {1140}, {1141}, {1148}, {1149}, {1150}, {1151}, {1154}, {1156}, {1159}, {1161}, {1166}, {1168}, {1176}, {1177}, {1178}, {1180}, {1183}, {1184}, {1186}, {1187}, {1190}, {1191} }; new exhaust[28][0] = { {1018}, {1019}, {1020}, {1021}, {1022}, {1028}, {1029}, {1037}, {1043}, {1044}, {1045}, {1046}, {1059}, {1064}, {1065}, {1066}, {1089}, {1092}, {1104}, {1105}, {1113}, {1114}, {1126}, {1127}, {1129}, {1132}, {1135}, {1136} }; new bventr[2][0] = { {1042}, {1044} }; new bventl[2][0] = { {1043}, {1045} }; new bscoop[4][0] = { {1004}, {1005}, {1011}, {1012} }; new rscoop[13][0] = { {1006}, {1032}, {1033}, {1035}, {1038}, {1053}, {1054}, {1055}, {1061}, {1067}, {1068}, {1088}, {1091} }; new lskirt[21][0] = { {1007}, {1026}, {1031}, {1036}, {1039}, {1042}, {1047}, {1048}, {1056}, {1057}, {1069}, {1070}, {1090}, {1093}, {1106}, {1108}, {1118}, {1119}, {1133}, {1122}, {1134} }; new rskirt[21][0] = { {1017}, {1027}, {1030}, {1040}, {1041}, {1051}, {1052}, {1062}, {1063}, {1071}, {1072}, {1094}, {1095}, {1099}, {1101}, {1102}, {1107}, {1120}, {1121}, {1124}, {1137} }; new hydraulics[1][0] = { {1087} }; new base[1][0] = { {1086} }; new rbbars[2][0] = { {1109}, {1110} }; new fbbars[2][0] = { {1115}, {1116} }; new wheels[17][0] = { {1025}, {1073}, {1074}, {1075}, {1076}, {1077}, {1078}, {1079}, {1080}, {1081}, {1082}, {1083}, {1084}, {1085}, {1096}, {1097}, {1098} }; new lights[2][0] = { {1013}, {1024} }; // enum tInfo { mod1, mod2, mod3, mod4, mod5, mod6, mod7, mod8, mod9, mod10, mod11, mod12, mod13, mod14, mod15, mod16, mod17, paintjob, colorA, colorB, } new TuneCar[MAX_VEHICLES][tInfo]; public OnVehicleSpawn(vehicleid) { //This timer is needed because if we add the components at OnVehicleSpawn, //the components will get added before the vehicle spawns... and than it isn't tuned SetTimer("VehicleSpawn",2000,0); //The components will be added with a delay of 2 second. } public OnVehicleDeath(vehicleid, killerid) { SaveModsForAll(vehicleid); return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { SaveModsForAll(vehicleid); return 1; } public TuneThisCar(vehicleid) { if(TuneCar[vehicleid][mod1]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod1]); } if(TuneCar[vehicleid][mod2]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod2]); } if(TuneCar[vehicleid][mod3]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod3]); } if(TuneCar[vehicleid][mod4]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod4]); } if(TuneCar[vehicleid][mod5]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod5]); } if(TuneCar[vehicleid][mod6]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod6]); } if(TuneCar[vehicleid][mod7]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod7]); } if(TuneCar[vehicleid][mod8]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod8]); } if(TuneCar[vehicleid][mod9]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod9]); } if(TuneCar[vehicleid][mod10]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod10]); } if(TuneCar[vehicleid][mod11]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod11]); } if(TuneCar[vehicleid][mod12]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod12]); } if(TuneCar[vehicleid][mod13]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod13]); } if(TuneCar[vehicleid][mod14]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod14]); } if(TuneCar[vehicleid][mod15]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod15]); } if(TuneCar[vehicleid][mod16]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod16]); } if(TuneCar[vehicleid][mod17]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod17]); } if(TuneCar[vehicleid][colorA]!=0 || TuneCar[vehicleid][colorB]!=0) { ChangeVehicleColor(vehicleid,TuneCar[vehicleid][colorA],TuneCar[vehicleid][colorB]); } if(TuneCar[vehicleid][paintjob]!=0) { ChangeVehiclePaintjob(vehicleid,TuneCar[vehicleid][paintjob]); } return 1; } InitComponents(componentid) { new i; for(i=0; i<20; i++) { if(spoiler[i][0]==componentid) { return 1; } } for(i=0; i<3; i++) { if(nitro[i][0]==componentid) { return 2; } } for(i=0; i<23; i++) { if(fbumper[i][0]==componentid) { return 3; } } for(i=0; i<22; i++) { if(rbumper[i][0]==componentid) { return 4; } } for(i=0; i<28; i++) { if(exhaust[i][0]==componentid) { return 5; } } for(i=0; i<2; i++) { if(bventr[i][0]==componentid) { return 6; } } for(i=0; i<2; i++) { if(bventl[i][0]==componentid) { return 7; } } for(i=0; i<4; i++) { if(bscoop[i][0]==componentid) { return 8; } } for(i=0; i<13; i++) { if(rscoop[i][0]==componentid) { return 9; } } for(i=0; i<21; i++) { if(lskirt[i][0]==componentid) { return 10; } } for(i=0; i<21; i++) { if(rskirt[i][0]==componentid) { return 11; } } if(hydraulics[0][0]==componentid) { return 12; } if(base[0][0]==componentid) { return 13; } for(i=0; i<2; i++) { if(rbbars[i][0]==componentid) { return 14; } } for(i=0; i<2; i++) { if(fbbars[i][0]==componentid) { return 15; } } for(i=0; i<17; i++) { if(wheels[i][0]==componentid) { return 16; } } for(i=0; i<2; i++) { if(lights[i][0]==componentid) { return 17; } } return 0; } // public OnVehicleMod(playerid,vehicleid,componentid) { new Varz=InitComponents(componentid); switch (Varz) { case 1: { TuneCar[vehicleid][mod1]=componentid; } case 2: { TuneCar[vehicleid][mod2]=componentid; } case 3: { TuneCar[vehicleid][mod3]=componentid; } case 4: { TuneCar[vehicleid][mod4]=componentid; } case 5: { TuneCar[vehicleid][mod5]=componentid; } case 6: { TuneCar[vehicleid][mod6]=componentid; } case 7: { TuneCar[vehicleid][mod7]=componentid; } case 8: { TuneCar[vehicleid][mod8]=componentid; } case 9: { TuneCar[vehicleid][mod9]=componentid; } case 10: { TuneCar[vehicleid][mod10]=componentid; } case 11: { TuneCar[vehicleid][mod11]=componentid; } case 12: { TuneCar[vehicleid][mod12]=componentid; } case 13: { TuneCar[vehicleid][mod13]=componentid; } case 14: { TuneCar[vehicleid][mod14]=componentid; } case 15: { TuneCar[vehicleid][mod15]=componentid; } case 16: { TuneCar[vehicleid][mod16]=componentid; } case 17: { TuneCar[vehicleid][mod17]=componentid; } } printf("Composant Ajouter: %d",componentid); SaveModsForAll(vehicleid); return 1; } public OnVehiclePaintjob(playerid,vehicleid, paintjobid) { TuneCar[vehicleid][paintjob]=paintjobid; return 1; } // public LoadModsForAll(vehicleid) { new formatLD[256]; format(formatLD,sizeof(formatLD),"voituresmods/%d.mods",vehicleid); if(dini_Exists(formatLD)) { TuneCar[vehicleid][mod1] = dini_Int(formatLD, "mod1"); TuneCar[vehicleid][mod2] = dini_Int(formatLD, "mod2"); TuneCar[vehicleid][mod3] = dini_Int(formatLD, "mod3"); TuneCar[vehicleid][mod4] = dini_Int(formatLD, "mod4"); TuneCar[vehicleid][mod5] = dini_Int(formatLD, "mod5"); TuneCar[vehicleid][mod6] = dini_Int(formatLD, "mod6"); TuneCar[vehicleid][mod7] = dini_Int(formatLD, "mod7"); TuneCar[vehicleid][mod8] = dini_Int(formatLD, "mod8"); TuneCar[vehicleid][mod9] = dini_Int(formatLD, "mod9"); TuneCar[vehicleid][mod10] = dini_Int(formatLD, "mod10"); TuneCar[vehicleid][mod11] = dini_Int(formatLD, "mod11"); TuneCar[vehicleid][mod12] = dini_Int(formatLD, "mod12"); TuneCar[vehicleid][mod13] = dini_Int(formatLD, "mod13"); TuneCar[vehicleid][mod14] = dini_Int(formatLD, "mod14"); TuneCar[vehicleid][mod15] = dini_Int(formatLD, "mod15"); TuneCar[vehicleid][mod16] = dini_Int(formatLD, "mod16"); TuneCar[vehicleid][mod17] = dini_Int(formatLD, "mod17"); TuneCar[vehicleid][paintjob] = dini_Int(formatLD, "paintjob"); TuneCar[vehicleid][colorA] = dini_Int(formatLD, "color1"); TuneCar[vehicleid][colorB] = dini_Int(formatLD, "color2"); } else { dini_Create(formatLD); } return 0; } public SaveModsForAll(vehicleid) { new formatLD[256]; format(formatLD,sizeof(formatLD),"voituresmods/%d.mods",vehicleid); if(dini_Exists(formatLD)) { dini_IntSet(formatLD,"mod1",TuneCar[vehicleid][mod1]); dini_IntSet(formatLD,"mod2",TuneCar[vehicleid][mod2]); dini_IntSet(formatLD,"mod3",TuneCar[vehicleid][mod3]); dini_IntSet(formatLD,"mod4",TuneCar[vehicleid][mod4]); dini_IntSet(formatLD,"mod5",TuneCar[vehicleid][mod5]); dini_IntSet(formatLD,"mod6",TuneCar[vehicleid][mod6]); dini_IntSet(formatLD,"mod7",TuneCar[vehicleid][mod8]); dini_IntSet(formatLD,"mod9",TuneCar[vehicleid][mod9]); dini_IntSet(formatLD,"mod10",TuneCar[vehicleid][mod10]); dini_IntSet(formatLD,"mod11",TuneCar[vehicleid][mod11]); dini_IntSet(formatLD,"mod12",TuneCar[vehicleid][mod12]); dini_IntSet(formatLD,"mod13",TuneCar[vehicleid][mod13]); dini_IntSet(formatLD,"mod14",TuneCar[vehicleid][mod14]); dini_IntSet(formatLD,"mod15",TuneCar[vehicleid][mod15]); dini_IntSet(formatLD,"mod16",TuneCar[vehicleid][mod16]); dini_IntSet(formatLD,"mod17",TuneCar[vehicleid][mod17]); dini_IntSet(formatLD,"paintjob",TuneCar[vehicleid][paintjob]); dini_IntSet(formatLD,"color1",TuneCar[vehicleid][colorA]); dini_IntSet(formatLD,"color2",TuneCar[vehicleid][colorB]); } else { dini_Create(formatLD); dini_IntSet(formatLD,"mod1",TuneCar[vehicleid][mod1]); dini_IntSet(formatLD,"mod2",TuneCar[vehicleid][mod2]); dini_IntSet(formatLD,"mod3",TuneCar[vehicleid][mod3]); dini_IntSet(formatLD,"mod4",TuneCar[vehicleid][mod4]); dini_IntSet(formatLD,"mod5",TuneCar[vehicleid][mod5]); dini_IntSet(formatLD,"mod6",TuneCar[vehicleid][mod6]); dini_IntSet(formatLD,"mod7",TuneCar[vehicleid][mod8]); dini_IntSet(formatLD,"mod9",TuneCar[vehicleid][mod9]); dini_IntSet(formatLD,"mod10",TuneCar[vehicleid][mod10]); dini_IntSet(formatLD,"mod11",TuneCar[vehicleid][mod11]); dini_IntSet(formatLD,"mod12",TuneCar[vehicleid][mod12]); dini_IntSet(formatLD,"mod13",TuneCar[vehicleid][mod13]); dini_IntSet(formatLD,"mod14",TuneCar[vehicleid][mod14]); dini_IntSet(formatLD,"mod15",TuneCar[vehicleid][mod15]); dini_IntSet(formatLD,"mod16",TuneCar[vehicleid][mod16]); dini_IntSet(formatLD,"mod17",TuneCar[vehicleid][mod17]); dini_IntSet(formatLD,"paintjob",TuneCar[vehicleid][paintjob]); dini_IntSet(formatLD,"color1",TuneCar[vehicleid][colorA]); dini_IntSet(formatLD,"color2",TuneCar[vehicleid][colorB]); } return 0; } public OnVehicleRespray(playerid,vehicleid, color1, color2) { TuneCar[vehicleid][colorA] = color1; TuneCar[vehicleid][colorB] = color2; return 1; } public VehicleSpawn(vehicleid) { TuneThisCar(vehicleid); LoadModsForAll(vehicleid); return 1; } // public OnFilterScriptInit() { print(" =============Iniciado============= "); print(" FS Sistema de Tunning by: Gnomo_Psicodelico "); print(" =============Iniciado============= "); AddStaticPickup(1242,1365.7645,-1650.0399,13.3828); // Menu tunning Create3DTextLabel("Loja de Tunning 1\nUse /tunning",AMARELO,1365.7645,-1650.0399,13.3828,15,0); return 1; } //================================================== = Comandos =============================================== public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/rxenon", true)==0) { if(Xenons[playerid] == 0) return SendClientMessage(playerid,0xFFFFFFAA,"Você não pode adicionar xenon,remova-o antes!"); if(Xenons[playerid] == 1) { DestroyObject(Xenons[0]); DestroyObject(Xenons[1]); DestroyObject(Xenons[2]); DestroyObject(Xenons[3]); DestroyObject(Xenons[4]); DestroyObject(Xenons[5]); DestroyObject(Xenons[6]); DestroyObject(Xenons[7]); Xenons[playerid]=0; GameTextForPlayer(playerid,"~b~~h~~h~Xenon removido com sucesso!",2000,3); } return 1; } if(strcmp(cmdtext, "/tunning", true) == 0 || strcmp(cmdtext, "/tunning", true) == 0) { if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER) { if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,VERMELHO,"Você precisa estar em um veículo!"); if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,VERMELHO,"Você precisa estar em um veículo!"); if(IsPlayerOnBike(playerid)) return SendClientMessage(playerid,AZUL,"Você não pode adicionar xenon em bicicletas/motos!"); if(IsPlayerOnHeli(playerid)) return SendClientMessage(playerid,AZUL,"Você não pode adicionar xenon em helicopteros!"); if(IsPlayerOnPlane(playerid)) return SendClientMessage(playerid,AZUL,"Você não pode adicionar xenon em aviões!"); if(IsPlayerInBoat(playerid)) return SendClientMessage(playerid,AZUL,"Você não pode adicionar xenon em barcos!"); if(IsPlayerOnBicycle(playerid)) return SendClientMessage(playerid,AZUL,"Você não pode adicionar xenon em bicicletas/motos!"); if(IsPlayerOnRC(playerid)) return SendClientMessage(playerid,AZUL,"Você não pode adicionar xenon em RC Vehicle!"); ShowPlayerDialog(playerid, loja, DIALOG_STYLE_LIST, "Tunning","Xenon\nPaintjob\nNeon","Ok","Sair") ; } else return SendClientMessage(playerid,VERMELHO,"Você não é o condutor de um veículo!"); return 1; } return 0; } //================================================== = KEYS =============================================== public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == 262144) { if(IsPlayerInAnyVehicle(playerid)) if (IsPlayerInRangeOfPoint(playerid, 3,1365.7645,-1650.0399,13.3828)) OnPlayerCommandText(playerid,"/tunning"); return 1; } return 1; } //================================================== = exec =============================================== public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == loja) { if(response) { switch(listitem) { case 0: { ShowPlayerDialog(playerid, Xenon, DIALOG_STYLE_LIST, "Xenons R$ 1.000,00","Xenon Azul\nXenon Verde\nXenon Branco\nXenon Vermelho\nRemover Xenon","OK","Sair"); } case 1: { ShowPlayerDialog(playerid, Paintjob, DIALOG_STYLE_LIST, "Paintjob R$ 5.000,00","Paintjob 1\nPaintjob 2\nPaintjob 3\nPaintjob 4","OK","Sair"); } } } } if(dialogid == Xenon) { if(response) { switch(listitem) { case 0: { if(Xenons[playerid] == 1) return SendClientMessage(playerid,0xFFFFFFAA,"Seu veiculo já tem um xenon,remova-o antes!"); if(GetPlayerMoney(playerid) < 1000){SendClientMessage(playerid, BRANCO, " Você não pode comprar esta Xenon, não tem dinheiro suficiente.");return true;} GivePlayerMoney(playerid, -1000); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); Xenons[0] = CreateObject(19298,0,0,0,0,0,0); Xenons[1] = CreateObject(19298,0,0,0,0,0,0); AttachObjectToVehicle(Xenons[0], GetPlayerVehicleID(playerid), 0.679999, 3.315028, -0.234999, 0.000000, 0.000000, -88.589958); AttachObjectToVehicle(Xenons[1], GetPlayerVehicleID(playerid), -0.729999, 3.315028, -0.234999, 0.000000, 0.000000, -88.589958); GameTextForPlayer(playerid,"~b~~h~xenon azul~n~~b~~h~adicionado",2000,3); } case 1: { if(Xenons[playerid] == 1) return SendClientMessage(playerid,0xFFFFFFAA,"Seu veiculo já tem xenon,remova-o antes!!"); if(GetPlayerMoney(playerid) < 1000){SendClientMessage(playerid, BRANCO, " Você não pode comprar esta Xenon, não tem dinheiro suficiente.");return true;} GivePlayerMoney(playerid, -1000); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); Xenons[2] = CreateObject(19297,0,0,0,0,0,0); Xenons[3] = CreateObject(19297,0,0,0,0,0,0); AttachObjectToVehicle(Xenons[2], GetPlayerVehicleID(playerid), 0.679999, 3.315028, -0.234999, 0.000000, 0.000000, -88.589958); AttachObjectToVehicle(Xenons[3], GetPlayerVehicleID(playerid), -0.729999, 3.315028, -0.234999, 0.000000, 0.000000, -88.589958); GameTextForPlayer(playerid,"~g~~h~Xenon verde~n~~g~~h~adicionado",2000,3); } case 2: { if(Xenons[playerid] == 1) return SendClientMessage(playerid,0xFFFFFFAA,"Seu veiculo já tem xenon,remova-o antes!!"); if(GetPlayerMoney(playerid) < 1000){SendClientMessage(playerid, BRANCO, " Você não pode comprar esta Xenon, não tem dinheiro suficiente.");return true;} GivePlayerMoney(playerid, -1000); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); Xenons[4] = CreateObject(19295,0,0,0,0,0,0); Xenons[5] = CreateObject(19295,0,0,0,0,0,0); AttachObjectToVehicle(Xenons[4], GetPlayerVehicleID(playerid), 0.679999, 3.315028, -0.234999, 0.000000, 0.000000, -88.589958); AttachObjectToVehicle(Xenons[5], GetPlayerVehicleID(playerid), -0.729999, 3.315028, -0.234999, 0.000000, 0.000000, -88.589958); GameTextForPlayer(playerid,"~w~~h~Xenon branco~n~~w~~h~adicionado",2000,3); } case 3: { if(Xenons[playerid] == 1) return SendClientMessage(playerid,0xFFFFFFAA,"Seu veiculo já tem xenon,remova-o antes!!"); if(GetPlayerMoney(playerid) < 1000){SendClientMessage(playerid, BRANCO, " Você não pode comprar esta Xenon, não tem dinheiro suficiente.");return true;} GivePlayerMoney(playerid, -1000); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); Xenons[6] = CreateObject(19296,0,0,0,0,0,0); Xenons[7] = CreateObject(19296,0,0,0,0,0,0); AttachObjectToVehicle(Xenons[6], GetPlayerVehicleID(playerid), 0.679999, 3.315028, -0.234999, 0.000000, 0.000000, -88.589958); AttachObjectToVehicle(Xenons[7], GetPlayerVehicleID(playerid), -0.729999, 3.315028, -0.234999, 0.000000, 0.000000, -88.589958); GameTextForPlayer(playerid,"~r~~h~Xenon vermelho~n~~r~~h~adicionado",2000,3); } case 4: { DestroyObject(Xenons[0]); DestroyObject(Xenons[1]); DestroyObject(Xenons[2]); DestroyObject(Xenons[3]); DestroyObject(Xenons[4]); DestroyObject(Xenons[5]); DestroyObject(Xenons[6]); DestroyObject(Xenons[7]); GameTextForPlayer(playerid,"~b~~h~~h~Xenon removido com sucesso",2000,3); } } } } if(dialogid == Paintjob) { if(response) { switch(listitem) { case 0: { if(GetPlayerMoney(playerid) < 5000){SendClientMessage(playerid, VERMELHO, " Você não pode comprar este Paintjob, não tem dinheiro suficiente.");return true;} GivePlayerMoney(playerid, -5000); ChangeVehiclePaintjob(GetPlayerVehicleID(playerid) , 0); } case 1: { if(GetPlayerMoney(playerid) < 5000){SendClientMessage(playerid, VERMELHO, " Você não pode comprar este Paintjob, não tem dinheiro suficiente.");return true;} GivePlayerMoney(playerid, -5000); ChangeVehiclePaintjob(GetPlayerVehicleID(playerid) , 1); } case 2: { if(GetPlayerMoney(playerid) < 5000){SendClientMessage(playerid, VERMELHO, " Você não pode comprar este Paintjob, não tem dinheiro suficiente.");return true;} GivePlayerMoney(playerid, -5000); ChangeVehiclePaintjob(GetPlayerVehicleID(playerid) , 2); } case 3: { if(GetPlayerMoney(playerid) < 5000){SendClientMessage(playerid, VERMELHO, " Você não pode comprar este Paintjob, não tem dinheiro suficiente.");return true;} GivePlayerMoney(playerid, -5000); ChangeVehiclePaintjob(GetPlayerVehicleID(playerid) , 3); } } } } return 1; } IsPlayerOnBike(playerid) { if(IsPlayerInAnyVehicle(playerid)) { new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid)); switch(vehicleclass) { case 448:return 1; case 461:return 1; case 462:return 1; case 463:return 1; case 468:return 1; case 521:return 1; case 522:return 1; case 523:return 1; case 581:return 1; case 586:return 1; case 471:return 1; } } return 0; } //BOATS IsPlayerInBoat(playerid) { if(IsPlayerInAnyVehicle(playerid)) { new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid)); switch(vehicleclass) { case 430:return 1; case 446:return 1; case 452:return 1; case 453:return 1; case 454:return 1; case 472:return 1; case 473:return 1; case 484:return 1; case 493:return 1; case 595:return 1; } } return 0; } //BICYCLES IsPlayerOnBicycle(playerid) { if(IsPlayerInAnyVehicle(playerid)) { new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid)); switch(vehicleclass) { case 481:return 1; case 509:return 1; case 510:return 1; } } return 0; } //HELICOPTERS IsPlayerOnHeli(playerid) { if(IsPlayerInAnyVehicle(playerid)) { new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid)); switch(vehicleclass) { case 417:return 1; case 425:return 1; case 447:return 1; case 469:return 1; case 487:return 1; case 488:return 1; case 497:return 1; case 548:return 1; case 563:return 1; } } return 0; } //PLANES IsPlayerOnPlane(playerid) { if(IsPlayerInAnyVehicle(playerid)) { new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid)); switch(vehicleclass) { case 460:return 1; case 476:return 1; case 511:return 1; case 512:return 1; case 519:return 1; case 520:return 1; case 553:return 1; case 577:return 1; case 592:return 1; case 593:return 1; case 509:return 1; } } return 0; } //RC VEHICLES IsPlayerOnRC(playerid) { if(IsPlayerInAnyVehicle(playerid)) { new vehicleclass = GetVehicleModel(GetPlayerVehicleID(playerid)); switch(vehicleclass) { case 464:return 1; case 465:return 1; case 441:return 1; case 501:return 1; case 564:return 1; case 594:return 1; } } return 0; } #endif |