12.11.2015, 09:36
Hello,how can i set the DM arena to not give Wanted levels if you kill someone inside the arena (Very anoying),and how can I set to /napustidm(leavedm) without killing the player.To respawn him or something (Killing is in conflict with my /kill CMD).Thanks in advance who helps me
Код:
//***************************xxxSpeedxxx's DM ARENA FS************************** //#define FILTERSCRIPT #include <a_samp> #include <zcmd> new InDM[MAX_PLAYERS]; new Dead[MAX_PLAYERS]; #define COLOR_GREEN 0x33AA33AA #define COLOR_WHITE 0xFFFFFFFF #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" DM Arena by xxxSpeedxxx v1.0"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else #endif //STOCK stock GetName(playerid) { new pnameid[24]; GetPlayerName(playerid,pnameid,24); return pnameid; } public OnPlayerConnect(playerid) { InDM[playerid] = 0; return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { if(Dead[playerid] == 1) { SetPlayerHealth(playerid, 100); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 26, cellmax); GivePlayerWeapon(playerid, 28, cellmax); GivePlayerWeapon(playerid, 24, cellmax); GivePlayerWeapon(playerid, 34, cellmax); GivePlayerWeapon(playerid, 16, 20); new c = random(3); if (c == 0){ SetPlayerPos(playerid, -1128.71, 1057.77, 1346.41);} else if (c == 1){ SetPlayerPos(playerid, -1038.03, 1036.85, 1341.35);} else if (c == 2){ SetPlayerPos(playerid, -971.10, 1061.41, 1345.02);} SetPlayerInterior(playerid, 10); SetPlayerVirtualWorld(playerid, 1); SetPlayerTeam(playerid, playerid); SetPlayerSkin(playerid, 167); Dead[playerid] = 0; } return 1; } public OnPlayerDeath(playerid, killerid, reason) { if(InDM[playerid] == 1) { new msg[120], msg2[120]; format(msg, sizeof(msg), "Ubijen si %s!", GetName(playerid)); format(msg2, sizeof(msg2),"Ubio te %s!", GetName(killerid)); SendClientMessage(playerid, COLOR_GREEN, msg2); SendClientMessage(killerid, COLOR_GREEN, msg); SetPlayerHealth(killerid, 100); SetPlayerSkin(playerid, 167); Dead[playerid] = 1; SpawnPlayer(playerid); new c = random(3); if (c == 0){ SetPlayerPos(playerid, -1128.71, 1057.77, 1346.41);} else if (c == 1){ SetPlayerPos(playerid, -1038.03, 1036.85, 1341.35);} else if (c == 2){ SetPlayerPos(playerid, -971.10, 1061.41, 1345.02);} SetPlayerInterior(playerid, 10); SetPlayerVirtualWorld(playerid, 1); SetPlayerTeam(playerid, playerid); GivePlayerWeapon(playerid, 26, cellmax); GivePlayerWeapon(playerid, 16, 20); GivePlayerWeapon(playerid, 28, cellmax); GivePlayerWeapon(playerid, 24, cellmax); GivePlayerWeapon(playerid, 34, cellmax); } return 1; } CMD:napustidm(playerid, params[]) { if(InDM[playerid] == 0) { SendClientMessage(playerid, -1, "Nisi u DM areni!"); return 1; } else if(InDM[playerid] == 1) { InDM[playerid] = 0; SetPlayerVirtualWorld(playerid, 0); SetPlayerHealth(playerid, 0.00); SetPlayerInterior(playerid, 0); SendClientMessage(playerid, -1, "Napustio si DM arenu!!"); return 1; } return 1; } CMD:dmarena(playerid, params[]) { if(InDM[playerid] == 1) return SendClientMessage(playerid, -1, "Error: Ti si vec u DM areni!"); // Check back if his in the DM arena! InDM[playerid] = 1; // we declared him in the DM arena. GameTextForPlayer(playerid, "/napustidm da izades iz DM arene!", 3000, 4); // a little game text to tell him how to exit if he's bored from the arena. SendClientMessage(playerid, -1, "{66FF66}Dobrodosao u DM arenu! {BABABA}"); // Welcoming him to the arena.. new c = random(3); if (c == 0){ SetPlayerPos(playerid, -1128.71, 1057.77, 1346.41);} else if (c == 1){ SetPlayerPos(playerid, -1038.03, 1036.85, 1341.35);} else if (c == 2){ SetPlayerPos(playerid, -971.10, 1061.41, 1345.02);} SetPlayerInterior(playerid, 10); SetPlayerVirtualWorld(playerid, 1); SetPlayerTeam(playerid, playerid); // setting every player in a team, since every one has a unique playerid ResetPlayerWeapons(playerid); // removing his weapons from outside the arena SetPlayerColor(playerid, COLOR_WHITE); // setting everyone's color to white, u can change it SetPlayerSkin(playerid, 167); // setting his funny skin SetPlayerHealth(playerid, 100); // 100 for the health GivePlayerWeapon(playerid, 26, cellmax); GivePlayerWeapon(playerid, 28, cellmax); GivePlayerWeapon(playerid, 24, cellmax); GivePlayerWeapon(playerid, 34, cellmax); GivePlayerWeapon(playerid, 16, 20); // we gave him the weapons here. new str[200], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(str, sizeof(str), "{FFFFFF}%s {BABABA}(ID: %d) se teleportirao u DM arenu! Pridruzi mu se koristeci /dmarena !", name, playerid); SendClientMessageToAll(-1, str);// we just announced to everyone that he entered the arena return 1; }