Anyway, since I've fixed it already by my self, I wonder if someone who had this problem also, want it to be solved, since there are alot of people with kinda problems.
Alright, so.. how I've fixed it :
I've created an enum:
PHP код:
enum pInfo
{
dwON
};
Then, I've created an array :
PHP код:
new PlayerInfo[MAX_PLAYERS][pInfo];
After that, I've created some command, wich will turn the enum on, for example(my own command)
PHP код:
if (strcmp("/dwall", cmdtext, true, 10) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i))
{
SendClientMessage(i, COLOR_BLUE, "Admin has warped everyone to D-W map");
PlayerInfo[i][dwON] = 1;
SetWorldTime(8);
if(gTeam[i] == TEAM_CT)
{
SetPlayerArmour(i,100);
SetPlayerHealth(i,100);
SetPlayerPos(i, 165.78, 1690.75 , 17.64);
GivePlayerWeapon(playerid, 24, 100);
GivePlayerWeapon(playerid, 16, 3);
GivePlayerWeapon(playerid, 31, 300);
GivePlayerWeapon(playerid, 29, 150);
}
else if(gTeam[i] == TEAM_T)
{
SetPlayerArmour(i,100);
SetPlayerHealth(i,100);
SetPlayerPos(i, 159.33, 1721.94, 17.64);
GivePlayerWeapon(playerid, 24, 100);
GivePlayerWeapon(playerid, 16, 3);
GivePlayerWeapon(playerid, 31, 300);
GivePlayerWeapon(playerid, 29, 150);
}
}
}
Nobody knows for what I've done it right?
I've done it to make an If command, wich checks if dwON == 1 - Then I can do something with it, so in my situation, I gone to OnPlayerSpawn and added :
PHP код:
if(PlayerInfo[playerid][dwON] == 1)
{
if(gTeam[playerid] == TEAM_CT)
{
SetPlayerArmour(playerid,100);
SetPlayerHealth(playerid,100);
SetPlayerPos(playerid, 165.78, 1690.75 , 17.64);
GivePlayerWeapon(playerid, 24, 100);
GivePlayerWeapon(playerid, 16, 3);
GivePlayerWeapon(playerid, 31, 300);
GivePlayerWeapon(playerid, 29, 150);
}
else if(gTeam[playerid] == TEAM_T)
{
SetPlayerArmour(playerid,100);
SetPlayerHealth(playerid,100);
SetPlayerPos(playerid, 159.33, 1721.94, 17.64);
GivePlayerWeapon(playerid, 24, 100);
GivePlayerWeapon(playerid, 16, 3);
GivePlayerWeapon(playerid, 31, 300);
GivePlayerWeapon(playerid, 29, 150);
}
}
}
And now, when I wanted to play as regular, I've created this :
PHP код:
if(strcmp("/dwalloff", cmdtext, true, 10) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
PlayerInfo[i][dwON] = 0;
return 1;
}
I hope it helps someone, atleast it helped to me, and I wanted to share it with you so another people wich have the same problem can get it solved here.