Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <core>
- #include <float>
- #include <Dini>
- #pragma tabsize 0
- main()
- {
- print("\n----------------------------------");
- print(" BIKE GAME MOD LOADING\n");
- print("----------------------------------\n");
- }
- //CORES
- #define COR_ADMINAVISO 0xE5273FFF
- #define COR_BRANCO 0xF6F6F6AA
- #define TEAM_GROVE 0x33AA33AA
- #define TEAM_BALLAS 0xFF00FFAA
- #define TEAM_LOS 0x00FFFFAA
- #define TEAM_VAGOS 0xFFFF00AA
- #define COR_AZUL 0x00FFFF
- #define COR_PRETO 0x0000FF
- #define COR_VERMELHO 0xFF0000AA
- #define COR_ROXO 0x9900FFAA
- #define COR_LARANJA 0xF6B347AA
- #define COR_INICIAL 0x7B68EE
- #define COR_ASSALTO1 0x008586AA
- #define COR_ASSALTO2 0xF6BD75AA
- #define COR_DROGA1 0xBF4847AA
- #define COR_DROGA2 0xC28400AA
- #define COR_MATS1 0x366239AA
- #define COR_MATS2 0xD9F6ADAA
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COR_RADIO 0x006BF6AA
- #define COR_VERDE 0x009900AA
- #define COR_AMARELO 0xF6E659AA
- #define COR_CINZENTO 0xB4B4B4CD
- //define pra salvar
- #define ARQUIVO_PLAYER "Players/%s.ini"
- //define para quantas rwos existem
- #define numerorwo 5
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- ShowPlayerMarkers(1);
- ShowNameTags(1);
- AllowAdminTeleport(1);
- AddPlayerClass(0,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(1,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(2,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(3,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(4,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(5,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(6,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(7,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(8,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- AddPlayerClass(9,670.4485,889.5360,-40.3449,121.8850,0,0,0,0,-1,-1);
- UsePlayerPedAnims();
- return 1;
- }
- new _bikeid[MAX_PLAYERS];
- new _playerbike[MAX_PLAYERS];
- new _onrace[MAX_PLAYERS];
- new _valrwo[numerorwo][2] =
- {
- {0,0},
- {1,5},
- {6,10},
- {0,0},
- {0,0}
- };
- new Stats[MAX_PLAYERS][numerorwo];
- new Float:Checkpoints[11][4] =
- {
- {0.0,0.0,0.0,0.0},
- //rwo 1 , 1 ate 5
- {0.0,2157.1760,-1184.9639,23.3362},
- {0.0,2124.3694,-1203.2394,27.6699},
- {0.0,2099.3826,-1187.6034,30.0747},
- {0.0,2039.3665,-1114.3225,29.3787},
- {0.0,2027.1888,-1115.5092,33.7415},
- //rwo 2 , 6 ate 10
- {0.0,2068.1426,-1140.7107,23.7332},
- {0.0,2068.0876,-1157.7153,23.6974},
- {0.0,2068.2061,-1176.7998,23.6583},
- {0.0,2068.5181,-1195.3827,23.7019},
- {0.0,2068.7502,-1213.3203,23.8166}
- };
- public OnGameModeExit()
- {
- return 1;
- }
- SetupPlayerForClassSelection(playerid)
- {
- SetPlayerInterior(playerid,14);
- SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
- SetPlayerFacingAngle(playerid, 270.0);
- SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
- SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetupPlayerForClassSelection(playerid);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- setvalzero(playerid);
- GameTextForPlayer(playerid,"BIKE MODE !",5000,5);
- new Name[24],FileP[64];
- GetPlayerName(playerid,Name,24);
- format(FileP, sizeof(FileP), ARQUIVO_PLAYER, Name);
- if(!UsuarioExiste(playerid))
- {
- dini_Create(FileP);
- dini_IntSet(FileP,"Nivel",0);
- dini_IntSet(FileP,"Bike",509);
- }
- _playerbike[playerid] = dini_Int(FileP,"Bike");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerHealth(playerid,99999);
- SetPlayerArmour(playerid,99999);
- SetPlayerInterior(playerid,0);
- TogglePlayerClock(playerid,0);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/bike", cmdtext, true, 10) == 0)
- {
- setbike(playerid);
- return 1;
- }
- else if (strcmp("/menurwo", cmdtext, true, 10) == 0)
- {
- new str[64] = "RWO 1\nRWO 2\nRWO 3\nRWO 4";
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Menu de RWO", str, "Selecionar", "Cancelar");
- return 1;
- }
- else if (strcmp("/comprarbike", cmdtext, true, 10) == 0)
- {
- new str[100] = "BMX - MELHOR PARA EMPINAR\nBIKE DE CORRIDA - MAIS RAPIDA \nBIKE PADRAO - MAIS AGIL EM MANOBRAS";
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Compra de bicicletas", str, "Comprar", "Cancelar");
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(_onrace[playerid] > 0)
- {
- SendClientMessage(playerid, COR_VERMELHO, "Voce caiu, entao a rwo foi desativada");
- DisablePlayerRaceCheckpoint(playerid);
- setvalzero(playerid);
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- new oldrwo , newrwo;
- if(_onrace[playerid] > 0)
- {
- new racenumero;
- racenumero = _onrace[playerid];
- if(Stats[playerid][racenumero] < _valrwo[racenumero][1]-1)
- {
- DisablePlayerRaceCheckpoint(playerid);
- oldrwo = Stats[playerid][racenumero] + 1;
- newrwo = Stats[playerid][racenumero] + 2;
- new string[300];
- format(string,60,"stats %i , _valrwo %i , oldrwo %i",Stats[playerid][racenumero], _valrwo[racenumero][1],oldrwo);
- SendClientMessage(playerid, COR_VERMELHO, string);
- setracecheck(playerid, 0, oldrwo, newrwo, 0);
- Stats[playerid][racenumero] = oldrwo;
- }
- else if(Stats[playerid][racenumero] == _valrwo[racenumero][1]-1)
- {
- DisablePlayerRaceCheckpoint(playerid);
- oldrwo = Stats[playerid][racenumero] + 1;
- newrwo = Stats[playerid][racenumero] + 1;
- setracecheck(playerid, 1, oldrwo, newrwo, 5);
- Stats[playerid][racenumero] = oldrwo;
- }
- else if(Stats[playerid][racenumero] == _valrwo[racenumero][1])
- {
- SendClientMessage(playerid, COR_VERMELHO, "Voce passou essa e ganhou 3 pontos");
- GivePlayerMoney(playerid, 10000);
- Stats[playerid][racenumero] = 0;
- _onrace[playerid] = 0;
- setlevel(playerid, 2);
- DisablePlayerRaceCheckpoint(playerid);
- }
- else
- {
- SendClientMessage(playerid, COR_VERMELHO, "OCORREU UM ERRO , CONTATE UM ADMIN, CODIGO DO ERRO: 21864");
- }
- }
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 0)
- {
- if(response)
- {
- if(listitem >= 0)
- {
- new valrwo;
- valrwo = listitem;
- valrwo = ++valrwo;
- setrwo(playerid, valrwo);
- }
- }
- }
- else if(dialogid == 1)
- {
- if(response)
- {
- if(listitem == 0)
- {
- new nivel,FileP[64];
- nivel = getlevel(playerid);
- if(nivel >= 50)
- {
- FileP = getplayerlocal(playerid);
- dini_IntSet(FileP,"Bike",481);
- _playerbike[playerid] = 481;
- setlevel(playerid, -50);
- setbike(playerid);
- }
- else
- {
- new level,str[300];
- level = getlevel(playerid);
- format(str,200,"Voce nao tem pontos suficientes, nessesarios : 50 , seus pontos : %i",level);
- SendClientMessage(playerid, COR_VERMELHO, str);
- }
- }
- else if(listitem == 1)
- {
- new nivel,FileP[64];
- nivel = getlevel(playerid);
- if(nivel >= 30)
- {
- FileP = getplayerlocal(playerid);
- dini_IntSet(FileP,"Bike",510);
- _playerbike[playerid] = 510;
- setlevel(playerid, -50);
- setbike(playerid);
- }
- else
- {
- new level,str[300];
- level = getlevel(playerid);
- format(str,200,"Voce nao tem pontos suficientes, nessesarios : 30 , seus pontos : %i",level);
- SendClientMessage(playerid, COR_VERMELHO, str);
- }
- }
- else if(listitem == 2)
- {
- new nivel,FileP[64];
- nivel = getlevel(playerid);
- if(nivel >= 10)
- {
- FileP = getplayerlocal(playerid);
- dini_IntSet(FileP,"Bike",509);
- _playerbike[playerid] = 509;
- setlevel(playerid, -50);
- setbike(playerid);
- }
- else
- {
- new level,str[300];
- level = getlevel(playerid);
- format(str,200,"Voce nao tem pontos suficientes, nessesarios : 10 , seus pontos : %i",level);
- SendClientMessage(playerid, COR_VERMELHO, str);
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- stock getlevel(playerid)
- {
- new Local[64], valnivel;
- Local = getplayerlocal(playerid);
- valnivel = dini_Int(Local,"Nivel");
- return valnivel;
- }
- stock setlevel(playerid, level)
- {
- new valnivel;
- valnivel = getlevel(playerid);
- if(level > 0)
- {
- valnivel = valnivel + level;
- new local[64];
- local = getplayerlocal(playerid);
- dini_IntSet(local,"Nivel",valnivel);
- }
- else if(level < 0)
- {
- valnivel = valnivel - level;
- new local[64];
- local = getplayerlocal(playerid);
- dini_IntSet(local,"Nivel",valnivel);
- }
- }
- stock setrwo(playerid, valrwo)
- {
- new currentvehicle , modelvehicle;
- currentvehicle = GetPlayerVehicleID(playerid);
- modelvehicle = GetVehicleModel(currentvehicle);
- if(modelvehicle == 481)
- {
- _onrace[playerid] = valrwo;
- Stats[playerid][valrwo] = _valrwo[valrwo][0]+1;
- valrwo = _valrwo[valrwo][0];
- SetVehiclePos(currentvehicle, Checkpoints[valrwo][1], Checkpoints[valrwo][2], Checkpoints[valrwo][3]);
- PutPlayerInVehicle(playerid, currentvehicle, 0);
- new valrwo2, valrwo3;
- valrwo2 = valrwo + 1;
- valrwo3 = valrwo + 2;
- SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[valrwo2][1], Checkpoints[valrwo2][2], Checkpoints[valrwo2][3], Checkpoints[valrwo3][1], Checkpoints[valrwo3][2], Checkpoints[valrwo3][3], 2);
- }
- else
- {
- SendClientMessage(playerid, COR_VERDE, "Voce nao esta com uma bicicleta !");
- }
- }
- stock getvalrwo(valrwo)
- {
- valrwo = _valrwo[valrwo][0];
- return valrwo;
- }
- stock getplayerlocal(playerid)
- {
- new Name[24],FileP[64];
- GetPlayerName(playerid,Name,24);
- format(FileP, sizeof(FileP), ARQUIVO_PLAYER, Name);
- return FileP;
- }
- stock setracecheck(playerid, style, val1, val2, final)
- {
- SetPlayerRaceCheckpoint(playerid, style, Checkpoints[val1][1], Checkpoints[val1][2], Checkpoints[val1][3], Checkpoints[val2][1], Checkpoints[val2][2], Checkpoints[val2][3]-final, 2);
- }
- stock setvalzero(playerid)
- {
- _onrace[playerid] = 0;
- _bikeid[playerid] = 0;
- for(new p;p==numerorwo;p++)
- {
- Stats[playerid][p] = 0;
- }
- }
- stock UsuarioExiste(playerid)
- {
- new name[MAX_PLAYER_NAME],checarp[30];
- GetPlayerName(playerid, name, sizeof(name));
- format(checarp, sizeof(checarp),ARQUIVO_PLAYER,name);
- if(fexist(checarp)) return true;
- return false;
- }
- stock setbike(playerid)
- {
- new currentveh;
- currentveh = GetPlayerVehicleID(playerid);
- if(currentveh>0)
- {
- DestroyVehicle(currentveh);
- }
- if(_bikeid[playerid] > 0)
- {
- DestroyVehicle(_bikeid[playerid]);
- }
- new Float:x, Float:y, Float:z, Float:angle;
- GivePlayerWeapon(playerid,32,99999);
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, angle);
- new vehicleid = CreateVehicle(_playerbike[playerid], x, y, z, angle, -1, -1, -1);
- _bikeid[playerid] = vehicleid;
- PutPlayerInVehicle(playerid, vehicleid, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement