#include <a_samp>
new bool:indm[MAX_PLAYERS];
public OnPlayerConnect(playerid){
indm[playerid]=false;
return 1;
}
public OnPlayerSpawn(playerid){
indm[playerid]=false;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/dm1\", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 2,3,4);
GivePlayerWeapon(playerid, 39, 10);
indm[playerid]=true;
return 1;
}
if (strcmp(\"/drift2\", cmdtext, true, 10) == 0)
{
if(indm[playerid] == true) return SendClientMessage(playerid,0xFFFF00AA,\"dm zónába vagy /exitdm\");
SetPlayerPos(playerid, 1,1,1);
return 1;
}
if (strcmp(\"/exitdm\", cmdtext, true, 10) == 0)
{
if(indm[playerid] == false) return SendClientMessage(playerid,0xFFFF00AA,\"nem vagy dm zónába\");
indm[playerid]=false;
ResetPlayerWeapons(playerid);
SpawnPlayer(playerid);
SendClientMessage(playerid,0xFFFF00AA,\"kiléptél a dm zónából\");
return 1;
}
return 0;
}
Mostanába nagyon sokat használok változót =DD