06.10.2018, 14:57
Quote:
public OnPlayerStateChange(playerid, newstate, oldstate) { new vehicleid = GetPlayerVehicleID(playerid); new caridx = CarSysID[vehicleid]; for(new i; i < MAX_VEHICLES; i++) { if(vehicleid == PizzaBoy[i] && InPizzaMission[playerid] == 1 && PizzaMissionStarted == 1 && newstate == PLAYER_STATE_ONFOOT) { InPizzaMission[playerid] = 0; PizzaMissionStarted = 0; DestroyVehicle(PizzaBoy[i]); SetVehicleToRespawn(PizzaBoy[i]); SetPlayerVirtualWorld(playerid, 0); DisablePlayerRaceCheckpoint(playerid); SpawnPlayer(playerid); SendClientMessage(playerid,COLOR_ORANGE,"!йцаъ одшлб ерфсмъ бощйод"); KillTimer(PizzaMission2[playerid]); format(String,sizeof(String),".ма дтбйш аъ дощмез бжоп \"%s\" щмйз дфйцд",GetName(playerid)); SendClientMessageToAll(COLOR_ORANGE,String); } } for(new i; i < MAX_VEHICLES; i++) { if(vehicleid == admincars[i] && !IsPlayerDAdmin(playerid)&& newstate == PLAYER_STATE_DRIVER) { new Float, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+7); PlayerPlaySound(playerid, 1136, 0.0, 0.0, 0.0); GameTextForPlayer(playerid,"~r~Admins Vehicle!",3000,4); SendClientMessage(playerid, COLOR_KRED, "!айрк йлем мдлрс мшлб цееъ"); } if(vehicleid == vipcars[i] && IsPlayerInAnyVehicle(playerid) && newstate == PLAYER_STATE_DRIVER && userdata[playerid][userisvip] == 0) { new Float, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+7); PlayerPlaySound(playerid, 1136, 0.0, 0.0, 0.0); GameTextForPlayer(playerid,"~r~VIP Vehicle!",3000,4); SendClientMessage(playerid, COLOR_KRED, "!V.I.P айрк йлем мдлрс мшлб"); } if(vehicleid == carshop[i] && IsPlayerInAnyVehicle(playerid) && newstate == PLAYER_STATE_DRIVER) { new Float, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z+7); PlayerPlaySound(playerid, 1136, 0.0, 0.0, 0.0); GameTextForPlayer(playerid,"~r~Display Vehicle!",3000,4); SendClientMessage(playerid, COLOR_KRED, "!айрк йлем мдлрс мшлб ъцевд"); } } // ================================= Normal =========================================== /// if(newstate == PLAYER_STATE_DRIVER) { SetPlayerArmedWeapon(playerid,0); } if(newstate == PLAYER_STATE_DRIVER) { if(vehdata[caridx][carowned] == 1 && !strcmp(GetName(playerid), vehdata[caridx][carowner], true)) { format(String,sizeof(String),"{FF9900}\"%s\" {FFFFFF}:щйвшъ аъ шлбк осев",VehNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]); SendClientMessage(playerid,-1,String); if(userdata[playerid][insurance] == 0) return SendClientMessage(playerid,COLOR_KRED,"/InsuranceHelp - айп мк бйиез мшлб"); if(userdata[playerid][insurance] == 1) { format(String,sizeof(String), "{FFFFFF}.дйре шлб обеиз {FF0000}\"%s\" {FFFFFF}:шлб",VehNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]); SendClientMessage(playerid,-1,String); SendClientMessage(playerid,-1,"/Fix - мъйчеп дшлб добеиз шщен"); } } else if(vehdata[caridx][carowned] == 1 && strcmp(GetName(playerid), vehdata[caridx][carowner], true) && vehdata[caridx][carsetprice] != 0) { format(String, 256, "./BuyCar еоецт молйшд бозйш щм $%d тм оръ мшлещ шлб жд шщен %s шлб жд роца ббтмеъ дщзчп",vehdata[caridx][carsetprice], vehdata[caridx][carowner]); SendClientMessage(playerid, COLOR_KRED, String); } else if(vehdata[caridx][carowned] == 1 && strcmp(GetName(playerid), vehdata[caridx][carowner], true)) { format(String, 256, ".%s шлб жд роца ббтмеъ дщзчп", vehdata[caridx][carowner]); SendClientMessage(playerid, COLOR_KRED, String); } } if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { if(LastVehicleTick[playerid] == -1) { LastVehicleTick[playerid] = GetTickCount(); } else { if( ( GetTickCount() - LastVehicleTick[playerid] ) <= 100) { LastVehicleWarns[playerid]++; if(LastVehicleWarns[playerid] >= 2) { format(SAC_WeaponString, 120, "GC_Guard: %s has been kicked from the server (Vehicle Hacks).", GetName(playerid)); SendClientMessageToAll(COLOR_KRED, SAC_WeaponString); SendClientMessageToAll(COLOR_YELLOW, "[Anti-Cheat] All vehicles has been respawned due to vehicle hacks being detected."); SetTimerEx("KickPlayer",200,false,"i",playerid); Kick(playerid); KillTimer(respawncarstimer); respawncarstimer = SetTimer("RespawnAllCars", 1000, 0); } } } } LastVehicleTick[playerid] = GetTickCount(); if(newstate == PLAYER_STATE_ONFOOT) { SetPlayerArmedWeapon(playerid, 0); SAC_WeaponCheck[playerid] = 0; SAC_RealWeapCheck[playerid] = SetTimerEx("RealWeaponCheck", 1500, 0, "i", playerid); } if(oldstate == 2 && newstate != 2 && AntiOn[playerid] != 0 && MyVeh[playerid] > -1) return PutPlayerInVehicle(playerid,MyVeh[playerid],0); if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { if(userdata[playerid][usercodetype] == 7 && AntiOn[playerid] == 1) { AntiOn[playerid] = 1; } } if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER && newstate == PLAYER_STATE_ONFOOT) { if(userdata[playerid][usercodetype] == 7 && AntiOn[playerid] == 1) { PutPlayerInVehicle(playerid, MyVeh[playerid], 0); } } return 1; } |
Thanks a lot !