30.04.2015, 06:19
https://www.youtube.com/watch?v=L5nk...ature=*********
+ Unable to get into their cars when went down .
+ Unable to get into their cars when went down .
Код:
#include <a_samp> new nrg[MAX_PLAYERS][7]; public OnFilterScriptInit() return print("[FS]NRG Mod Loader!"); public OnFilterScriptExit() { for(new i=0; i < MAX_PLAYERS+1; i++){ if(nrg[i][0]){ DestroyObject(nrg[i][0]); DestroyObject(nrg[i][1]); DestroyObject(nrg[i][2]); DestroyObject(nrg[i][3]); RemovePlayerAttachedObject(i, 3); nrg[i][0] = 0; } } return print("[FS]Ghostrider Unloaded!"); } public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/nrgmod", true)) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "He Thong: Ban phai o trong chiec xe NRG-500!"); if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "He Thong: Ban phai la nguoi dieu khien chiec xe!"); if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 522) return SendClientMessage(playerid, 0xFF0000AA, "He Thong: Ban phai o trong chiec xe NRG-500 !"); if(nrg[playerid][0] == 0) { DestroyObject(nrg[playerid][0]); DestroyObject(nrg[playerid][1]); DestroyObject(nrg[playerid][2]); DestroyObject(nrg[playerid][3]); RemovePlayerAttachedObject(playerid, 3); nrg[playerid][0] = 0; } new Float:vh; GetVehicleHealth(GetPlayerVehicleID(playerid), vh); if(vh < 250) return 0; // not enough health else { nrg[playerid][0] = CreateObject(362, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][1] = CreateObject(359, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][2] = CreateObject(359, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][3] = CreateObject(1254, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][4] = CreateObject(954, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][5] = CreateObject(1550, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][6] = CreateObject(1550, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); AttachObjectToVehicle(nrg[playerid][0], GetPlayerVehicleID(playerid), 0.06080, 0.67080, 0.58939, 0.00000, 30.00000, 95.28001); AttachObjectToVehicle(nrg[playerid][1], GetPlayerVehicleID(playerid), 0.28294, 0.55306, 0.01810, 0.00000, 0.00000, 90.24004); AttachObjectToVehicle(nrg[playerid][2], GetPlayerVehicleID(playerid), -0.19430, 0.52830, 0.01810, 0.00000, 0.00000, 90.24000); AttachObjectToVehicle(nrg[playerid][3], GetPlayerVehicleID(playerid), -0.00101, 1.78877, 0.35295, 0.00000, 0.00000, 0.00000); AttachObjectToVehicle(nrg[playerid][4], GetPlayerVehicleID(playerid), 0.00000, 0.86230, 0.07600, 70.00000, 0.00000, -3.54000); AttachObjectToVehicle(nrg[playerid][5], GetPlayerVehicleID(playerid), 0.29508, -0.59719, 0.17033, 0.00000, 0.00000, -113.81998); AttachObjectToVehicle(nrg[playerid][6], GetPlayerVehicleID(playerid), -0.25780, -0.63270, 0.17030, 0.00000, 0.00000, 0.00000); ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0); return 1; } } return 0; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT){ if(nrg[playerid][0]){ DestroyObject(nrg[playerid][0]); DestroyObject(nrg[playerid][1]); DestroyObject(nrg[playerid][2]); DestroyObject(nrg[playerid][3]); RemovePlayerAttachedObject(playerid, 3); nrg[playerid][0] = 0; } } if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_WASTED){ if(nrg[playerid][0]){ DestroyObject(nrg[playerid][0]); DestroyObject(nrg[playerid][1]); DestroyObject(nrg[playerid][2]); DestroyObject(nrg[playerid][3]); RemovePlayerAttachedObject(playerid, 3); nrg[playerid][0] = 0; } } if(oldstate == PLAYER_STATE_DRIVER) { if(nrg[playerid][0]) { DestroyObject(nrg[playerid][0]); DestroyObject(nrg[playerid][1]); DestroyObject(nrg[playerid][2]); DestroyObject(nrg[playerid][3]); RemovePlayerAttachedObject(playerid, 3); nrg[playerid][0] = 0; } } if(newstate == PLAYER_STATE_DRIVER) { if(!IsPlayerInAnyVehicle(playerid)) return 0; if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 0; if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 463) return 0; new Float:vh; GetVehicleHealth(GetPlayerVehicleID(playerid), vh); if(vh < 250) return 0; // not enough health else { nrg[playerid][0] = CreateObject(362, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][1] = CreateObject(359, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][2] = CreateObject(359, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][3] = CreateObject(1254, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][4] = CreateObject(954, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][5] = CreateObject(1550, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); nrg[playerid][6] = CreateObject(1550, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0); AttachObjectToVehicle(nrg[playerid][0], GetPlayerVehicleID(playerid), 0.06080, 0.67080, 0.58939, 0.00000, 30.00000, 95.28001); AttachObjectToVehicle(nrg[playerid][1], GetPlayerVehicleID(playerid), 0.28294, 0.55306, 0.01810, 0.00000, 0.00000, 90.24004); AttachObjectToVehicle(nrg[playerid][2], GetPlayerVehicleID(playerid), -0.19430, 0.52830, 0.01810, 0.00000, 0.00000, 90.24000); AttachObjectToVehicle(nrg[playerid][3], GetPlayerVehicleID(playerid), -0.00101, 1.78877, 0.35295, 0.00000, 0.00000, 0.00000); AttachObjectToVehicle(nrg[playerid][4], GetPlayerVehicleID(playerid), 0.00000, 0.86230, 0.07600, 70.00000, 0.00000, -3.54000); AttachObjectToVehicle(nrg[playerid][5], GetPlayerVehicleID(playerid), 0.29508, -0.59719, 0.17033, 0.00000, 0.00000, -113.81998); AttachObjectToVehicle(nrg[playerid][6], GetPlayerVehicleID(playerid), -0.25780, -0.63270, 0.17030, 0.00000, 0.00000, 0.00000); ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0); return 1; } } return 1; } public OnPlayerConnect(playerid) { nrg[playerid][0] = 0; nrg[playerid][1] = 0; nrg[playerid][2] = 0; } public OnPlayerDisconnect(playerid, reason) { if(nrg[playerid][0]){ DestroyObject(nrg[playerid][0]); DestroyObject(nrg[playerid][1]); DestroyObject(nrg[playerid][2]); DestroyObject(nrg[playerid][3]); RemovePlayerAttachedObject(playerid, 3); nrg[playerid][0] = 0; } }