Hello mindenki
Csinaltam egy rovid DM scriptet.
Sokaknak van problemaja a /dm ,/exitdm paranccsal.Hat itt minden meg van.
Nyugodtan atlehet irni.
Hogy legyen kulonleges csinaltam egy olyan cuccot bele hogy ha pl.
beirod /dm1,elteleportalsz es ha kimesz a helyszinrol akkor vegye el a fegyodat.
ha pedig vissza mesz ismet vegye el az elozo fegyvert es adja meg a DM fegyvereket.
Teszteltem ugyhogy megy mint a motor xD.
[pawn] // DM area script
//A scriptet keszitette ElectroX aka (Light,Adams)
#include <a_samp>
#define FILTERSCRIPT
#define COLOR_RED 0xff0000AA
#if defined FILTERSCRIPT
forward KiBeMent(playerid);
new DMArena[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\"----DM script by ElectroX Loaded--------\");
print(\"--------------------------------------\\n\");
SetTimer(\"KiBeMent\", 10000, 1);
return 1;
}
#endif
new Float:RandomSpawn[][4] =
{
{-1468.9622,1490.6605,8.2578},
{-1405.3401,1485.7223,7.1016}
};
public OnPlayerConnect(playerid)
{
DMArena[playerid] = 0;
SendClientMessage(playerid,COLOR_RED, \"Ha DM ezni szeretnel ird /dm1\");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DMArena[playerid] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
DMArena[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if ( !strcmp( cmdtext, \"/exitdm\" ))
{
if (!DMArena[playerid]) return SendClientMessage( playerid, 0xff0000AA, \"Nem vagy DM zónában!?\");
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
DMArena[playerid] = 0;
ResetPlayerWeapons(playerid);
SendClientMessage( playerid, 0xff0000AA, \"Kiléptél a DM -bol!\" );
SpawnPlayer(playerid);
return 1;
}
new pname[MAX_PLAYER_NAME], string[40 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if ( !strcmp( cmdtext, \"/dm1\" ) )
{
if ( DMArena[playerid]) return SendClientMessage( playerid, 0xff0000AA, \"DM kozben nem lehet .Eloszor /exitdm!\");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
DMArena[playerid] = 1;
SendClientMessage(playerid,COLOR_RED,\"Ha meguntad ird /exitdm\");
format(string, sizeof(string), \"%s DM re ment(/dm1).\", pname);
SendClientMessageToAll(0x0dff00AA, string);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24 ,500);
GivePlayerWeapon(playerid, 27 ,1500);
GivePlayerWeapon(playerid, 32 ,500);
GivePlayerWeapon(playerid, 24 ,1500);
GivePlayerWeapon(playerid, 30 ,1500);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
new rand = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
return 1;
}
return 0;
}
/*Ez a sor segit abban hogy ha barki is kitud menekulni a DM zonabol akkor vegye el a fegyveret ha el megy
a DM zona kozelebol.
Reszletesebben:Ha a jatekos DM zonaban van,megvannak a DM fegyverei.Ha a jatekos kiszalad a DM zona kozelebol
akkor elveszi a fegyvereit.Ha pedig valaki a sajat fegyvereivel akar behatolni es a dm helyszin kozeleben van
akkor elveszi a fegyvereit es odaadja a DM fegyvereket. */
public KiBeMent(playerid)
{
if (DMArena[playerid])
{
if(!IsPlayerInRangeOfPoint(playerid, 80.0, -1423.6165,1493.2380,7.1016))
{
SendClientMessage(playerid,COLOR_RED, \"Kimentel a DM zonabol ezert elvesszuk a fegyod.
\");
ResetPlayerWeapons(playerid);
SetPlayerArmour(playerid,0);
DMArena[playerid] = 0;
}
}
if (!DMArena[playerid])
{
if(IsPlayerInRangeOfPoint(playerid, 80.0, -1423.6165,1493.2380,7.1016))
{
SendClientMessage(playerid,COLOR_RED, \"DM zonaba leptel ezert te is DMezhetsz\");
SendClientMessage(playerid,COLOR_RED, \"A fegyvereidet elveszited es megkapod az ujjat.\");
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24 ,500);
GivePlayerWeapon(playerid, 27 ,1500);
GivePlayerWeapon(playerid, 32 ,500);
GivePlayerWeapon(playerid, 24 ,1500);
GivePlayerWeapon(playerid, 30 ,1500);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
DMArena[playerid] = 1;
}
}
return 1;
}
[/pawn]
Letoltes:
http://solidfiles.com/d/95b9/