Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Vehicle Creator By KevinsL
- *
- * Acesse: www.MundoSAMP.net / www.BrasilRealLife.com
- * Favor não retirar os creditos!
- * Creditos a KevinsL
- */
- #include <a_samp>
- #define FILTERSCRIPT
- new carroagora;
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- public OnFilterScriptInit()
- {
- print("\n----------------------------------");
- print(" Vehicle Creator by KevinsL Loaded");
- print("-----------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n----------------------------------");
- print(" Vehicle Creator by KevinsL Unloaded");
- print("-----------------------------------\n");
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, 0xFF0000AA, "Vehicle Creator by KevinsL Loaded!");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- 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[])
- {
- new cmd[128], idx, tmp[256];
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/criarveiculo", true)==0 || strcmp(cmd, "/cv", true)==0 || strcmp(cmd, "/criarv", true)==0)
- {
- new modelo, cor1, cor2;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)){
- SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: /criarveiculo [modelo] [cor 1] [cor 2]");
- return 1;
- }
- modelo = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: /criarveiculo [modelo] [cor 1] [cor 2]");
- return 1;
- }
- cor1 = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: /criarveiculo [modelo] [cor 1] [cor 2]");
- return 1;
- }
- cor2 = strval(tmp);
- if(modelo >= 400 && modelo <= 611)
- {
- new stringsalvo[256];
- new Float:X, Float:Y, Float:Z, Float:Rotation;
- GetPlayerPos(playerid, X, Y, Z);
- if(IsPlayerInAnyVehicle(playerid))
- {
- carroagora = GetPlayerVehicleID(playerid);
- GetVehicleZAngle(carroagora, Rotation);
- }
- else
- {
- GetPlayerFacingAngle(playerid, Rotation);
- }
- new File:pos=fopen("carros.txt", io_append);
- format(stringsalvo, 256, "AddStaticVehicleEx(%d,%f,%f,%f,%f,%d,%d,600000); \n", modelo, X, Y, Z,Rotation,cor1,cor2);
- fwrite(pos, stringsalvo);
- print(stringsalvo);
- SendClientMessage(playerid, 0xFF0000AA, stringsalvo);
- fclose(pos);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Somente veiculos de 400 a 611!");
- }
- return 1;
- }
- if(strcmp(cmdtext, "/ajudavc", true)==0)
- {
- SendClientMessage(playerid, 0xFFFFFFAA, "Use: /criarveiculo [modelo] [cor 1] [cor 2] e crie um veiculo onde você está! o arquivo será salvo na pasta: scriptfiles");
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement