Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- // ===========================================================================
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 100
- // ===========================================================================
- #define function::%0(%1) forward %0(%1); public %0(%1)
- // ===========================================================================
- new PontosNoDesafio[MAX_PLAYERS];
- new Text:Textdraw1[MAX_PLAYERS];
- new Text:TextDrawInfo[MAX_PLAYERS];
- new Text:NSFDraw[MAX_PLAYERS];
- new playerDrift[MAX_PLAYERS];
- new DB: jogadoresRanking;
- new bool: JogadorJogando[ MAX_PLAYERS char];
- new bool: ArenaOcupada;
- new bool: iniciadoArena;
- // ===========================================================================
- public OnFilterScriptInit() {
- printf("Sistema de drift carregado !!");
- jogadoresRanking = db_open("drift.db");
- db_free_result(db_query(jogadoresRanking,"CREATE TABLE IF NOT EXISTS `Usuarios` (`jogador`,`Pontos`)"));
- SetTimer("DriftCounter", 850, true);
- return true;
- }
- public OnGameModeExit() {
- db_close(jogadoresRanking);
- return true;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- OnPlayerExitVehicle(playerid, -1);
- }
- public OnPlayerConnect(playerid) {
- NSFDraw[playerid] = TextDrawCreate(274.000000, 104.000000, "000,000");
- TextDrawBackgroundColor(NSFDraw[playerid], 255);
- TextDrawFont(NSFDraw[playerid], 1);
- TextDrawLetterSize(NSFDraw[playerid], 0.460000, 1.600000);
- TextDrawColor(NSFDraw[playerid], -39169);
- TextDrawSetOutline(NSFDraw[playerid], 1);
- TextDrawSetProportional(NSFDraw[playerid], 1);
- TextDrawTextSize(TextDrawInfo[playerid], 620.000000, 0.000000);
- static string[256];
- format(string, 128, "~n~~w~Drift Pontos: ~r~%d", getScoreData(playerid) );
- TextDrawInfo[playerid] = TextDrawCreate(500.000000, 110.000000, string);
- TextDrawBackgroundColor(TextDrawInfo[playerid], 255);
- TextDrawFont(TextDrawInfo[playerid], 1);
- TextDrawLetterSize(TextDrawInfo[playerid], 0.30000, 1.00000);
- TextDrawColor(TextDrawInfo[playerid], -1);
- TextDrawSetOutline(TextDrawInfo[playerid], 1);
- TextDrawSetProportional(TextDrawInfo[playerid], 1);
- TextDrawUseBox(TextDrawInfo[playerid], 0);
- TextDrawBoxColor(TextDrawInfo[playerid], 255);
- TextDrawTextSize(TextDrawInfo[playerid], 620.000000, 0.000000);
- ////////////////////////////////////////////////////
- Textdraw1[playerid] = TextDrawCreate(500.000000, 110.000000, "~h~~p~~h~Desafio drift:~n~~w~Eu: ~r~0~n~~w~Ele: ~r~0");
- TextDrawBackgroundColor(Textdraw1[playerid], 255);
- TextDrawFont(Textdraw1[playerid], 1);
- TextDrawLetterSize(Textdraw1[playerid], 0.30000, 1.00000);
- TextDrawColor(Textdraw1[playerid], -1);
- TextDrawSetOutline(Textdraw1[playerid], 1);
- TextDrawSetProportional(Textdraw1[playerid], 1);
- TextDrawUseBox(Textdraw1[playerid], 0);
- TextDrawBoxColor(Textdraw1[playerid], 255);
- TextDrawTextSize(Textdraw1[playerid], 620.000000, 0.000000);
- return true;
- }
- public OnPlayerSpawn(playerid) {
- TextDrawShowForPlayer(playerid, TextDrawInfo[playerid]);
- SetPlayerScore(playerid, getScoreData(playerid));
- return true;
- }
- new jogadoresEvento, jogadorQueFez, scoreApostado, jogadoresMortos;
- public OnPlayerExitVehicle(playerid, vehicleid) {
- if (JogadorJogando{playerid}) {
- //
- jogadoresMortos++; // 1
- //
- RemovePlayerFromVehicle(playerid);
- //
- new string[128];
- GetPlayerName (playerid, string, 25);
- format(string, 128, "[Info] O %s morreu no desafio (com %d pontos)", string, PontosNoDesafio[playerid]);
- SendClientMessageToAll(0xFF0000FF, string);
- //
- DestroyVehicle(GetPVarInt(playerid, "CarroDrift"));
- //
- JogadorJogando{playerid} = false;
- TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
- TextDrawShowForPlayer(playerid, TextDrawInfo[playerid]);
- SetPlayerScore(playerid, GetPlayerScore(playerid) - scoreApostado);
- //
- salvarJogador(playerid);
- PontosNoDesafio[playerid] = 0;
- SetTimerEx("SpawnEx", 3000, false, "i", playerid);
- if(jogadoresEvento == (jogadoresMortos + 1)) {
- for(playerid = 0; playerid != MAX_PLAYERS; playerid ++) {
- if(JogadorJogando{playerid}) break;
- }
- SetPlayerScore(playerid, GetPlayerScore(playerid) + (scoreApostado * jogadoresMortos));
- GetPlayerName (playerid, string, 25);
- format(string, 128, "[Info] O %s foi o grande vencedor e ganhou o bolada de %d de score", string, (scoreApostado * jogadoresMortos));
- SendClientMessageToAll(0x00FF00FF, string);
- iniciadoArena = false;
- //
- RemovePlayerFromVehicle(playerid);
- scoreApostado = 0;
- jogadorQueFez = -1;
- jogadoresEvento = 0;
- ArenaOcupada = false;
- JogadorJogando{playerid} = false;
- PontosNoDesafio[playerid] = 0;
- jogadoresMortos = 0;
- TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
- TextDrawShowForPlayer(playerid, TextDrawInfo[playerid]);
- DestroyVehicle(GetPVarInt(playerid, "CarroDrift"));
- salvarJogador(playerid);
- SetTimerEx("SpawnEx", 3000, false, "i", playerid);
- }
- //////////////////////////
- }
- TextDrawHideForPlayer(playerid, NSFDraw[playerid]);
- return true;
- }
- public OnPlayerDisconnect(playerid, reason) {
- salvarJogador(playerid);
- TextDrawDestroy(NSFDraw[playerid]);
- TextDrawDestroy(TextDrawInfo[playerid]);
- TextDrawDestroy(Textdraw1[playerid]);
- if (JogadorJogando{playerid}) {
- OnPlayerExitVehicle(playerid, -1);
- }
- return true;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext[1], "carroteste", true)) {
- SetPlayerScore(playerid, 5000);
- static Float: xPos[3];
- GetPlayerPos(playerid, xPos[0], xPos[1], xPos[2]);
- CreateVehicle(562, xPos[0], xPos[1], xPos[2], 82.2873, 0, 1, 60);
- return true;
- }
- if(!strcmp(cmdtext[1], "ranking", true)) {
- static
- query[128],
- nome[MAX_PLAYER_NAME],
- stringDialog[1024];
- nome[0] = 0,stringDialog[0] = 0,query[0] = 0;
- SendClientMessage(playerid, -1, "Melhores Jogadores");
- // new string2[128];
- new DBResult:result;
- new DBResult:playerResult;
- format(query, sizeof(query), "SELECT `jogador` FROM `Usuarios` ORDER BY (`Pontos` * 1) DESC limit 10");
- // main table
- result = db_query(jogadoresRanking, query);
- for(new i, r = db_num_rows(result); i != r; ++ i) {
- db_get_field(result, 0, nome, MAX_PLAYER_NAME);
- // get query player tab
- format(query, sizeof(query), "SELECT `pontos` FROM `Usuarios` WHERE `jogador` = '%s'", nome);
- // get player score
- db_get_field((playerResult = db_query(jogadoresRanking,query), playerResult), 0, query, 14);
- //
- format(stringDialog, sizeof stringDialog,"%s%02d \t %24s\t\t\tDrift (%05d)\n", stringDialog, (i +1) , nome, strval(query));
- //
- db_next_row(result);
- db_free_result(playerResult);
- }
- ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX, "Ranking", stringDialog, "Fechar", "Fechar");
- return db_free_result(result), true;
- }
- if(!strcmp(cmdtext[1], "entrar", true)) {
- if(!ArenaOcupada || iniciadoArena)
- return SendClientMessage(playerid, -1, "[Erro] A arena de drift está fechada. Digite /desafiar !!");
- if(IsPlayerInAnyVehicle(playerid)) {
- SendClientMessage(playerid, -1, "[Erro] Caso estiver em algum carro saia dele!");
- return true;
- }
- SendClientMessage(playerid, 0xFF00FF, "[Info] Para ganhar você precisa fazer 5 mil pontos a mais que seus adversário - Pontuação ao lado >");
- JogadorJogando{playerid} = true;
- SetPVarInt(playerid, "CarroDrift", CreateVehicle(562, 1501.4595,1321.5551- float(jogadoresEvento * 5),10.5013, 82.2873, 0, 1, 60));
- PutPlayerInVehicle(playerid, GetPVarInt(playerid, "CarroDrift"), 0);
- TogglePlayerControllable(playerid,0);
- GameTextForPlayer(playerid, "~w~Carregando !!" , 2500, 6);
- TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
- TextDrawHideForPlayer(playerid, TextDrawInfo[playerid]);
- jogadoresEvento ++;
- return true;
- }
- if(!strcmp(cmdtext[1], "desafiar", true, 8))
- {
- if(ArenaOcupada)
- return SendClientMessage(playerid, -1, "[Erro] A arena de drift está ocupada !!");
- new score, cmd[32];
- if(sscanf( cmdtext, "sd", cmd, score ) )
- return SendClientMessage(playerid, -1, "[Erro] Use corretamente: /desafiar [score]");
- if(score == 65535 || !score)
- return SendClientMessage(playerid, -1, "[Erro] Use um valor de score entre 1 e 65535");
- if(getScoreData(playerid) < score)
- return SendClientMessage(playerid, -1, "[Erro] Você não tem score suficiente para fazer aposta !!");
- static string[128];
- format(string, 128, "[Info] Um jogador abriu o evento de drift. Digite /entrar para entrar | VALOR DA APOSTA: {FF0000}%d | 30 SEGUNDOS !!", score);
- SendClientMessageToAll(-1, string);
- scoreApostado = score;
- jogadorQueFez = playerid;
- jogadoresEvento = 1;
- ArenaOcupada = true;
- SetPVarInt(playerid, "CarroDrift", CreateVehicle(562, 1501.4595,1321.5551,10.5013, 82.2873, 0, 1, 60));
- PutPlayerInVehicle(playerid, GetPVarInt(playerid, "CarroDrift"), 0);
- TogglePlayerControllable(playerid, 0);
- SendClientMessage(playerid, 0xFF00FF, "[Info] Para ganhar você precisa fazer 5 mil pontos a mais que seus adversário - Pontuação ao lado >");
- jogadoresMortos = 0;
- JogadorJogando{playerid} = true;
- SetTimer("IniciarDriftEvento", 10000, false);
- TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
- TextDrawHideForPlayer(playerid, TextDrawInfo[playerid]);
- return true;
- }
- return false;
- }
- public OnPlayerUpdate(playerid) {
- SetPVarInt(playerid, "SegundosTick", gettime());
- if( gettime() - GetPVarInt(playerid, "SegundosTick") > 1)
- salvarJogador(playerid);
- return true;
- }
- //
- //
- //
- //
- function::IniciarDriftEvento() {
- if(jogadoresEvento == 1) {
- scoreApostado = 0;
- JogadorJogando{jogadorQueFez} = false;
- jogadorQueFez = -1;
- jogadoresEvento = 0;
- TogglePlayerControllable(jogadorQueFez, 1);
- iniciadoArena = false;
- ArenaOcupada = true;
- return SendClientMessageToAll(-1, "[Info] Não foi possível iniciar o evento pois o número de jogadores foi pouco");
- }
- SetTimer("DriftEventoCheck", 1000, false);
- iniciadoArena = true;
- for(new i; i != MAX_PLAYERS; i++) {
- if(JogadorJogando{i} == true) {
- TogglePlayerControllable(i, true);
- GameTextForPlayer(i, "~w~Comece agora !!" , 3500, 6);
- }
- }
- return true;
- }
- //
- // @function: get score data
- // @author: Bruno da Silva
- //
- function::getScoreData(playerid) {
- new query[256], string[128];
- new DBResult:qresult, ret;
- GetPlayerName(playerid, string, MAX_PLAYER_NAME + 1);
- format(query,sizeof(query),"SELECT `Pontos` FROM `Usuarios` WHERE `jogador` = '%s'", string);
- qresult = db_query(jogadoresRanking,query);
- if(db_num_rows(qresult) == 1)
- {
- db_get_field(qresult,0,string,128);
- ret = strval(string);
- }
- db_free_result(qresult);
- return ret;
- }
- /////////////////////////////////////////////////////////
- //
- // @funcion: save data
- // @author: Bruno da Silva
- //
- ////////////////////////////////////////////////////////
- function::salvarJogador(playerid) {
- new tname[MAX_PLAYER_NAME + 1];
- GetPlayerName(playerid,tname,sizeof(tname));
- new query[256];
- format(query,sizeof(query),"SELECT `jogador` FROM `Usuarios` WHERE `jogador`=('%s') LIMIT 1",tname);
- new DBResult:qresult;
- qresult = db_query(jogadoresRanking,query);
- if(db_num_rows(qresult) == 1)
- {
- format(query,sizeof(query),"UPDATE `Usuarios` SET `Pontos`='%d' WHERE (`jogador` = ('%s'))",GetPlayerScore(playerid),tname);
- db_free_result(db_query(jogadoresRanking,query));
- }
- else if(db_num_rows(qresult) == 0)
- {
- format(query, sizeof(query), "INSERT INTO `Usuarios` (`jogador`,`Pontos`) VALUES(('%s'),%d)",tname ,GetPlayerScore(playerid));
- db_free_result(db_query(jogadoresRanking,query));
- }
- return true;
- }
- static bruno[ MAX_PLAYERS ] ;
- function::ReadRank(jogador[]) {
- new files[42];
- format(files, 42, "rank/%s.rank", jogador);
- new rank[32];
- if(!fexist(files)) return 0;
- new File: fp = fopen(files, io_read);
- fread(fp, rank, sizeof rank);
- fclose (fp);
- return strval(rank);
- }
- function::WriteRank(jogador[], rank) {
- new files[42];
- format(files, 42, "rank/%s.rank", jogador);
- new File: fp = fopen(files, io_write);
- format(files, 32, "%d", rank);
- fwrite(fp, files);
- fclose (fp);
- return true;
- }
- function::DriftEventoCheck() {
- if(iniciadoArena == true) {
- SetTimer("DriftEventoCheck", 1000, false);
- }
- new string[1024], nome[128];
- string = "~h~~p~~h~Desafio drift:~n~";
- for(new i; i != MAX_PLAYERS; i++) {
- if(JogadorJogando{i} == true) {
- GetPlayerName(i, nome, 24);
- format (nome, 128, "~w~%s: ~r~%d~n~", nome, PontosNoDesafio[i]);
- strcat(string, nome);
- //
- }
- }
- for(new i; i != MAX_PLAYERS; i++) {
- if(JogadorJogando{i}) {
- TextDrawSetString(Textdraw1[i], string);
- for(new j; j != MAX_PLAYERS; j++) {
- if(JogadorJogando{j} && j != i) {
- if (PontosNoDesafio[i] - PontosNoDesafio[j] > 5000 ) {
- OnPlayerExitVehicle(j, GetPlayerVehicleID(j));
- }
- else if ( PontosNoDesafio[j] - PontosNoDesafio[i] > 5000 ) {
- OnPlayerExitVehicle(i, GetPlayerVehicleID(i));
- }
- }
- }
- }
- }
- return true;
- }
- function::DriftEarn(playerid, score) {
- score *= 10;
- if (JogadorJogando{playerid}) {
- PontosNoDesafio[playerid] += score;
- }
- else {
- playerDrift [playerid] += score;
- TextDrawShowForPlayer(playerid, NSFDraw[playerid]);
- new string[128];
- switch(playerDrift [playerid])
- {
- case 000 .. 100: string = "~n~Drift";
- case 101 .. 400: string = "~n~Good Drift";
- case 401 .. 1200: string = "~n~Great Drift";
- case 1201 .. 3800: string = "~n~SUPERB DRIFT!";
- case 3801 .. 6000: string = "~n~COLOSSAL DRIFT!";
- case 6001 .. 20000: string = "~n~OUTRAGEOUS DRIFT!";
- case 20001 .. 40000: string = "~n~INSANE DRIFT!";
- default: string = "~n~~r~DRIFT KING!";
- }
- format(string, 128, "%0d%s", playerDrift [playerid], string);
- TextDrawSetString(NSFDraw[playerid], string);
- KillTimer(bruno[playerid]);
- bruno[playerid] = SetTimerEx("DriftCheck", 1700, false, "id", playerDrift[playerid], playerid);
- }
- return true;
- }
- public OnVehicleDamageStatusUpdate(vehicleid, playerid)
- {
- if(playerDrift[playerid] > 50) {
- playerDrift[playerid] = 0;
- TextDrawSetString(NSFDraw[playerid], "~r~FAIL");
- KillTimer(bruno[playerid]);
- }
- return 1;
- }
- function::DriftCheck(score, playerid) {
- if(playerDrift[playerid] == score && !JogadorJogando{playerid}) {
- TextDrawSetString(TextDrawInfo[playerid], "~g~Drifted !!");
- if(playerDrift[playerid] > 25000)
- {
- new string[128];
- new nome[32];
- GetPlayerName(playerid, nome, 32);
- if(playerDrift [playerid] > ReadRank(nome)) {
- WriteRank(nome, playerDrift [playerid]);
- format(string, 128, "[Info] O jogador \"%s\" chegou à seu recorde de %d em um único drift !!", nome, playerDrift [playerid]);
- SendClientMessageToAll(0x00FF00FF, string);
- }
- }
- SetPlayerScore(playerid, GetPlayerScore(playerid) + (playerDrift[playerid]/600));
- new string[256];
- format(string, 256, "~n~~w~Drift Pontos: ~r~%d", getScoreData(playerid));
- TextDrawSetString(TextDrawInfo[playerid], string);
- salvarJogador(playerid);
- playerDrift[playerid] = 0;
- TextDrawHideForPlayer(playerid, NSFDraw[playerid]);
- }
- return true;
- }
- function::DriftCounter() {
- for (new i; i != MAX_PLAYERS; i++) {
- if(IsPlayerInAnyVehicle(i)) {
- new vehicleid = GetPlayerVehicleID(i);
- if(IsCarVehicle(vehicleid)) {
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(vehicleid, x, y, z);
- new speed = floatround(floatsqroot(x*x+y*y+z*z)*200);
- if(speed > 1.0) {
- new radianos = floatround( atan2( y, x ) );
- if(radianos > 400) radianos -= 400;
- switch(radianos) {
- case 090 .. 180: radianos -= 90;
- case 181 .. 360: radianos += 90;
- default: radianos += 270;
- }
- ////////////////////////////////////////////////////////////////
- static
- Float: angle
- ;
- GetVehicleZAngle(vehicleid, angle);
- radianos = floatround( floatabs( radianos - angle ) );
- if(radianos > 180) {
- radianos = floatround( floatabs ( radianos - 360 ) );
- }
- new
- key[3];
- GetPlayerKeys(i, key[0], key[1], key[2]);
- if( key[0] != 32 && speed > 23 )
- {
- if( radianos > 3 && ((radianos * speed) / 30) < 300) {
- DriftEarn(i, (radianos * speed) / 35 ) ;
- }
- }
- ////////////////////////////////////////////////////////////////
- }
- }
- }
- }
- return true;
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // @function: SpawnEx — Correção para SpawnPlayer
- // @author: Bruno da Silva
- //
- //////////////////////////////////////////////////////////////////////////////
- function::SpawnEx(playerid) {
- SpawnPlayer(playerid);
- return true;
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // @function: sscanf
- // @author: Y_less
- //
- //////////////////////////////////////////////////////////////////////////////
- function::sscanf(string[], format[], {Float,_}:...)
- {
- #if defined isnull
- if (isnull(string))
- #else
- if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
- #endif
- {
- return format[0];
- }
- #pragma tabsize 4
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs(),
- delim = ' ';
- while (string[stringPos] && string[stringPos] <= ' ')
- {
- stringPos++;
- }
- while (paramPos < paramCount && string[stringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = string[++stringPos];
- }
- do
- {
- stringPos++;
- if ('0' <= ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return -1;
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- num = 0,
- ch = string[stringPos];
- do
- {
- stringPos++;
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- default:
- {
- return -1;
- }
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- new changestr[16], changepos = 0, strpos = stringPos;
- while(changepos < 16 && string[strpos] && string[strpos] != delim)
- {
- changestr[changepos++] = string[strpos++];
- }
- changestr[changepos] = '\0';
- setarg(paramPos,0,_:floatstr(changestr));
- }
- case 'p':
- {
- delim = format[formatPos++];
- continue;
- }
- case '\'':
- {
- new
- end = formatPos - 1,
- ch;
- while ((ch = format[++end]) && ch != '\'') {}
- if (!ch)
- {
- return -1;
- }
- format[end] = '\0';
- if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
- {
- if (format[end + 1])
- {
- return -1;
- }
- return 0;
- }
- format[end] = '\'';
- stringPos = ch + (end - formatPos);
- formatPos = end + 1;
- }
- case 'u':
- {
- new
- end = stringPos - 1,
- id = 0,
- bool:num = true,
- ch;
- while ((ch = string[++end]) && ch != delim)
- {
- if (num)
- {
- if ('0' <= ch <= '9')
- {
- id = (id * 10) + (ch - '0');
- }
- else
- {
- num = false;
- }
- }
- }
- if (num && IsPlayerConnected(id))
- {
- setarg(paramPos, 0, id);
- }
- else
- {
- #if !defined foreach
- #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
- #define __SSCANF_FOREACH__
- #endif
- string[end] = '\0';
- num = false;
- new
- name[MAX_PLAYER_NAME];
- id = end - stringPos;
- foreach (Player, playerid)
- {
- GetPlayerName(playerid, name, sizeof (name));
- if (!strcmp(name, string[stringPos], true, id))
- {
- setarg(paramPos, 0, playerid);
- num = true;
- break;
- }
- }
- if (!num)
- {
- setarg(paramPos, 0, INVALID_PLAYER_ID);
- }
- string[end] = ch;
- #if defined __SSCANF_FOREACH__
- #undef foreach
- #undef __SSCANF_FOREACH__
- #endif
- }
- stringPos = end;
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = string[stringPos++]) && ch != delim)
- {
- setarg(paramPos, i++, ch);
- }
- if (!i)
- {
- return -1;
- }
- }
- else
- {
- while ((ch = string[stringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
- {
- stringPos++;
- }
- while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
- {
- stringPos++;
- }
- paramPos++;
- }
- do
- {
- if ((delim = format[formatPos++]) > ' ')
- {
- if (delim == '\'')
- {
- while ((delim = format[formatPos++]) && delim != '\'') {}
- }
- else if (delim != 'z')
- {
- return delim;
- }
- }
- }
- while (delim > ' ');
- return 0;
- }
- ///////////////////////////////////////////////////////////////////////////////
- //
- // @function: Is Car Vehicle 1/0
- // @author: Made Man
- //
- //////////////////////////////////////////////////////////////////////////////
- function::IsCarVehicle(vehicleid)
- {
- switch(GetVehicleModel(vehicleid))
- {
- case
- 416, //ambulan - car
- 445, //admiral - car
- 602, //alpha - car
- 485, //baggage - car
- 568, //bandito - car
- 429, //banshee - car
- 499, //benson - car
- 424, //bfinject, //car
- 536, //blade - car
- 496, //blistac - car
- 504, //bloodra - car
- 422, //bobcat - car
- 609, //boxburg - car
- 498, //boxville, //car
- 401, //bravura - car
- 575, //broadway, //car
- 518, //buccanee, //car
- 402, //buffalo - car
- 541, //bullet - car
- 482, //burrito - car
- 431, //bus - car
- 438, //cabbie - car
- 457, //caddy - car
- 527, //cadrona - car
- 483, //camper - car
- 524, //cement - car
- 415, //cheetah - car
- 542, //clover - car
- 589, //club - car
- 480, //comet - car
- 596, //copcarla, //car
- 599, //copcarru, //car
- 597, //copcarsf, //car
- 598, //copcarvg, //car
- 578, //dft30 - car
- 486, //dozer - car
- 507, //elegant - car
- 562, //elegy - car
- 585, //emperor - car
- 427, //enforcer, //car
- 419, //esperant, //car
- 587, //euros - car
- 490, //fbiranch, //car
- 528, //fbitruck, //car
- 533, //feltzer - car
- 544, //firela - car
- 407, //firetruk, //car
- 565, //flash - car
- 455, //flatbed - car
- 530, //forklift, //car
- 526, //fortune - car
- 466, //glendale, //car
- 604, //glenshit, //car
- 492, //greenwoo, //car
- 474, //hermes - car
- 434, //hotknife, //car
- 502, //hotrina - car
- 503, //hotrinb - car
- 494, //hotring - car
- 579, //huntley - car
- 545, //hustler - car
- 411, //infernus, //car
- 546, //intruder, //car
- 559, //jester - car
- 508, //journey - car
- 571, //kart - car
- 400, //landstal, //car
- 403, //linerun - car
- 517, //majestic, //car
- 410, //manana - car
- 551, //merit - car
- 500, //mesa - car
- 418, //moonbeam, //car
- 572, //mower - car
- 423, //mrwhoop - car
- 516, //nebula - car
- 582, //newsvan - car
- 467, //oceanic - car
- 404, //peren - car
- 514, //petro - car
- 603, //phoenix - car
- 600, //picador - car
- 413, //pony - car
- 426, //premier - car
- 436, //previon - car
- 547, //primo - car
- 489, //rancher - car
- 441, //rcbandit, //car
- 594, //rccam - car
- 564, //rctiger - car
- 515, //rdtrain - car
- 479, //regina - car
- 534, //remingtn, //car
- 505, //rnchlure, //car
- 442, //romero - car
- 440, //rumpo - car
- 475, //sabre - car
- 543, //sadler - car
- 605, //sadlshit, //car
- 495, //sandking, //car
- 567, //savanna - car
- 428, //securica, //car
- 405, //sentinel, //car
- 535, //slamvan - car
- 458, //solair - car
- 580, //stafford, //car
- 439, //stallion, //car
- 561, //stratum - car
- 409, //stretch - car
- 560, //sultan - car
- 550, //sunrise - car
- 506, //supergt - car
- 601, //swatvan - car
- 574, //sweeper - car
- 566, //tahoma - car
- 549, //tampa - car
- 420, //taxi - car
- 459, //topfun - car
- 576, //tornado - car
- 583, //tug - car
- 451, //turismo - car
- 558, //uranus - car
- 552, //utility - car
- 540, //vincent - car
- 491, //virgo - car
- 412, //voodoo - car
- 478, //walton - car
- 421, //washing - car
- 529, //willard - car
- 555, //windsor - car
- 456, //yankee - car
- 554, //yosemite - car
- 477 //zr350 - car
- :
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement