Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*===================================================================
- Ghost Town on the engine (Grad Duhova )
- -» Autor : Nodze ( Dzenan Levic )
- -» Deskripcija : Plamen motora, poput duhova jahača
- ====================================================================*/
- #include <a_samp>
- #include < YSI\y_ini >
- #include < YSI\y_commands >
- //Kod ostalih Definicija.
- #define SCM SendClientMessage
- //Dodas gdje su ti ostali New-ovi
- new GhostTown[MAX_PLAYERS][3];
- //dodas u OnGameModeIni
- public OnFilterScriptInit()
- return print("Grad Duhova na motoru UCITANO!");
- //dodas u OnGameModeExit
- public OnFilterScriptExit()
- {
- for(new i=0; i < MAX_PLAYERS+1; i++){
- if(GhostTown[i][0]){
- DestroyObject(GhostTown[i][0]);
- DestroyObject(GhostTown[i][1]);
- DestroyObject(GhostTown[i][2]);
- GhostTown[i][0] = 0;
- }
- }
- return print("Grad Duhova na motoru NIJE UCITALO!");
- }
- //Ovo ide gdje su ti ostale komande, Prilagodi svojoj skripti komandu
- YCMD:motorduh(playerid, params[], help)
- {
- #pragma unused help
- // if(PlayerInfo[playerid][yAdministrator] >= 1 || PlayerInfo[playerid][yVIP] >= 3) return SCM(playerid,-1,""nodze_blue"Ghost Town"nodze_siva"Samo Administrator & Vip!"); //PRILAGODI SVOJOJ SKRIPTI
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "[GHOST TOWN] {FFFFFF}Morate biti u odredjenim motociklu: NRG - 500!");
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "[GHOST TOWN] {FFFFFF}Moras bit u motociklu!");
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 522) return SendClientMessage(playerid, 0xFF0000AA, "[GHOST TOWN] {FFFFFF}Moras bit u NRG-500 motorbike!");
- if(GhostTown[playerid][0]){
- DestroyObject(GhostTown[playerid][0]);
- DestroyObject(GhostTown[playerid][1]);
- DestroyObject(GhostTown[playerid][2]);
- GhostTown[playerid][0] = 0;
- return 1;
- }
- new Float:vh;
- GetVehicleHealth(GetPlayerVehicleID(playerid), vh);
- if(vh < 250) return SendClientMessage(playerid, 0xFF0000AA, "[GHOST TOWN] {FFFFFF}Prvo popravi svoj motocikl!");
- GhostTown[playerid][0] = CreateObject(18689, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
- GhostTown[playerid][1] = CreateObject(18689, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
- GhostTown[playerid][2] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
- AttachObjectToVehicle(GhostTown[playerid][0], GetPlayerVehicleID(playerid), 0.0, 0.6, -1.7, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(GhostTown[playerid][1], GetPlayerVehicleID(playerid), 0.0, -1.4, -1.7, 0.0, 0.0, 0.0);
- AttachObjectToPlayer(GhostTown[playerid][2], playerid, 0.0, -0.01, -0.9, 0.0, 0.0, 0.0);
- ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0);
- return 1;
- }
- // return 0;
- //}
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT){
- if(GhostTown[playerid][0]){
- DestroyObject(GhostTown[playerid][0]);
- DestroyObject(GhostTown[playerid][1]);
- DestroyObject(GhostTown[playerid][2]);
- GhostTown[playerid][0] = 0;
- }
- }
- if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_WASTED){
- if(GhostTown[playerid][0]){
- DestroyObject(GhostTown[playerid][0]);
- DestroyObject(GhostTown[playerid][1]);
- DestroyObject(GhostTown[playerid][2]);
- GhostTown[playerid][0] = 0;
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- GhostTown[playerid][0] = 0;
- GhostTown[playerid][1] = 0;
- GhostTown[playerid][2] = 0;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(GhostTown[playerid][0]){
- DestroyObject(GhostTown[playerid][0]);
- DestroyObject(GhostTown[playerid][1]);
- DestroyObject(GhostTown[playerid][2]);
- GhostTown[playerid][0] = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement