11.02.2011, 22:10
Код:
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); printf("%s", string); } return 1; } if (strcmp("/ajudacinto", cmdtext, true, 10) == 0) { SendClientMessage(playerid,COLOR_GREEN,"*** Para vocк colocar/tirar o cinto de seguranзa , Use /cinto. ***"); SendClientMessage(playerid,COLOR_GREEN,"*** Nгo pule do veiculo com cinto de seguranзa ou poderб MORRER ENFORCADO! ***"); SendClientMessage(playerid,COLOR_GREEN,"*** Evite andar sem cinto de seguranзa. Valorize a sua vida ! ***"); } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { SendClientMessage(playerid, COLOR_GREEN, "Para a sua seguranзa , ultilize o cinto de seguranca."); return 1; } public OnPlayerExitVehicle(playerid, vehicleid){ if(cinto[playerid] == 1){ SendClientMessage(playerid, COLOR_RED, "Vocк pulou do carro com cinto de seguranзa"); GameTextForPlayer(playerid, " ~r~Voce se enforcou com o cinto!", 5000, 3) SetPlayerHealth(playerid,0); GivePlayerMoney(playerid,-5000); } return 1; } // if (IsPlayerInAnyVehicle(playerid) == 1 && cinto[playerid] == 1) // cinto[playerid] = 0; public OnPlayerUpdate(playerid) { if(IsPlayerInAnyVehicle(playerid) == 1 && cinto[playerid] == 0) { new Float:TempCarHealth; GetVehicleHealth(GetPlayerVehicleID(playerid), TempCarHealth); new Float:Difference = floatsub(CarHealth[playerid], TempCarHealth); if((floatcmp(CarHealth[playerid], TempCarHealth) == 1) && (floatcmp(Difference,100.0) == 1)) { Difference = floatdiv(Difference, 10.0); new Float:OldHealth; GetPlayerHealth(playerid, OldHealth); SetPlayerHealth(playerid, floatsub(OldHealth, Difference)); } CarHealth[playerid] = TempCarHealth; } else { CarHealth[playerid] = 0.0; } return 1; }