19.03.2009, 19:35
Hi, i've made last a DeathMatch area with IsPlayerInArea in my stunt server. It had work first, but suddenly it do'nt work anymore. So i was wondering wat the best method is to make a DeathMatch Zone?
Ive tried this for my zone, but is i explained, it didn't work anymore.
But i think im going too far, there must be a easier way to do this?
This is what i want:
If you walk into the DM zone, godmode will be turned off. And if you walk out of the DM zone, DM wil be turned on. If you want to get out with a specefic vehicle, you will be killed. And i want to simply add new DM zones.
Is that possible? And how must i make that?
Sorry about my bad english...
Ive tried this for my zone, but is i explained, it didn't work anymore.
Код:
#include <a_samp> new DM[MAX_PLAYERS]; new Area69report[MAX_PLAYERS]; forward DeathMatch(playerid); forward IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy); public OnGameModeInit() { SetTimer("Area69", 400, 1); return 1; } public OnPlayerSpawn(playerid) { DM[playerid] = 0; Area69report[playerid] = 0; SetPlayerArmour(playerid, 1000); SetPlayerHealth(playerid, 1000); return 1; } public OnPlayerDeath(playerid, killerid, reason) { DM[playerid] = 0; Area69report[playerid] = 0; return 1; } public OnPlayerUpdate(playerid) { if (DM[playerid] == 0) { new Float:Health; GetPlayerHealth(playerid,Health); if (Health < 100) { SetPlayerHealth(playerid,100); } if (IsPlayerInAnyVehicle(playerid) == 1) { new PlayerCar; new Float:CarHealth; PlayerCar = GetPlayerVehicleID(playerid); GetVehicleHealth(PlayerCar,CarHealth); if (CarHealth < 1000) { SetVehicleHealth(PlayerCar, 1000.0); } } } return 1; } IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if (x > minx && x < maxx && y > miny && y < maxy) return 1; { DM[playerid] = 1; } return 0; } public DeathMatch(playerid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if (IsPlayerInArea(i,-55.5792, 418.7632, 1664.8753, 2119.9753) == 1) { if (Area69report[i] == 0) { SendClientMessage(i, RED, "test"); DM[playerid] = 1; Area69report[i] = 1; } } } } return 1; }
This is what i want:
If you walk into the DM zone, godmode will be turned off. And if you walk out of the DM zone, DM wil be turned on. If you want to get out with a specefic vehicle, you will be killed. And i want to simply add new DM zones.
Is that possible? And how must i make that?
Sorry about my bad english...