Sziasztok!!!
a cim mindent elmondt.
Segítsetek:(
#include <a_samp>
forward lvdmchekpoint(playerid);
forward joinDM(playerid);
forward exitDM(playerid);
new lvdm,lvdmjoin,lvdmexit, lvbeirtak;
new eWep[MAX_PLAYERS][13][2];
#define SavePlayerWeapons(%1) \\
for(new usualy = 0; usualy < 13; usualy++) GetPlayerWeaponData(%1, usualy, eWep[%1][usualy][0], eWep[%1][usualy][1])
#define LoadPlayerWeapons(%1) ResetPlayerWeapons(%1);\\
for(new usualy = 0; usualy < 13; usualy++) GivePlayerWeapon(%1,eWep[%1][usualy][0], eWep[%1][usualy][1])
static dmid[MAX_PLAYERS]={1};
//--------------------------------------------------
public lvdmchekpoint(playerid)//chekpoint megjelenités
{
SetPlayerCheckpoint(playerid,1898.8331, 2314.3550, 10.8203, 5.0); // Ez a CP
SetPVarInt(playerid, \"CP\", lvdm);
for(new i=0; i<MAX_PLAYERS; i++)
{
SendClientMessageToAll(0xFFFF00FF, \"Megjelent az Lv-dm Lehet jeletkezni!!.\");
lvdmjoin=SetTimer(\"joinDM\",60000, true);//1percig jelenik meg a checkpoint.
return i;
}
return 1;
}
public joinDM(playerid) //Belépés dmbe
{
if(lvbeirtak <= 0)// ide majd 1 est irj
{
KillTimer(lvdm);
KillTimer(lvdmjoin);
DisablePlayerCheckpoint(playerid);
SendClientMessageToAll(0xFFFF00FF, \"Nem indult ell az Lv-dm!!!.\");
}
else if(dmid[playerid]==1)
{
SavePlayerWeapons(playerid);
OnPlayerSpawn(playerid);
KillTimer(lvdm);
KillTimer(lvdmjoin);
SendClientMessageToAll(0xFFFF00FF, \"Elindult az Lv-dm!!.\");
GivePlayerWeapon(playerid,31,50000);
DisablePlayerCheckpoint(playerid);
lvdmexit=SetTimer(\"exitDM\",60000, true);//Checkpoint 1 perc után kirak a dm-bõl.
}
}
public exitDM(playerid) //kilpés dmbe
{
if(dmid[playerid]==1)
{
LoadPlayerWeapons(playerid);
KillTimer(lvdmexit);
SendClientMessageToAll(0xFFFF00FF, \"Vége van az Lv-dmnek!!.\");
SetPlayerPos(playerid,1898.8331, 2314.3550, 10.8203); // kirakás dm böl pozició
dmid[playerid] = 0;
}
}
public OnPlayerConnect(playerid)
{
for (new i = 0; i < 13; i++)
{
eWep[playerid][0] = 0;
eWep[playerid][1] = 0;
}
dmid[playerid] = 0;
}
public OnFilterScriptInit()
{
lvdm = SetTimer(\"lvdmchekpoint\",60000, true);//Csatlakozás után 1percel jelenik meg a checkpoint
return 1;
}
public OnPlayerSpawn(playerid)
{
if(dmid[playerid] == 1)
{
SetPlayerPos(playerid,2259.2493,590.0903,7.7802); // Elhelyezés a dMben. Itt akár véletlenszerû spawnot is írhatunk, de az átláthatóság kedvéért maradjunk ennél
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
OnPlayerSpawn(playerid);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, \"/join\", true) == 0)
{
if (GetPVarInt(playerid, \"CP\") == lvdm)//lvdm helye
{
dmid[playerid] = 1; // Azonosítószám megadása FONTOS
SendClientMessage(playerid, 0xFFFF00FF, \"Dm-re jelentkeztél!!!\");// szöveget átírhatod.
lvbeirtak++;
}
else
{
SendClientMessage(playerid, 0xFFFF00FF, \"Itt nem tudsz jelentkezni!\");// szöveget átírhatod.
}
return 1;
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetPVarInt(playerid, \"CP\") == lvdm)//lvdm helye
{
SendClientMessage(playerid, 0xFFFF00FF, \"Dm-re Jelentkezéshez Ird:/join Parancsot!!!\");
}
return 1;
}