new bool:testboolean;
public OnPlayerConnect(playerid)
{
testboolean = false;
return 1;
}
CMD:test(playerid, params[])
{
testboolean = true;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(testboolean == true)
{
SendClientMessage(playerid, COLOR_RED, "TRUE");
}
else
{
SendClientMessage(playerid, COLOR_RED, "FALSE");
}
return 1;
}
new bool:testboolean[ MAX_PLAYERS ];
testboolean[ playerid ] = true;
new bool:testboolean[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
testboolean[playerid] = false;
return 1;
}
CMD:test(playerid, params[])
{
testboolean[playerid] = true;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(testboolean[playerid] == true)
{
SendClientMessage(playerid, COLOR_RED, "TRUE");
}
else
{
SendClientMessage(playerid, COLOR_RED, "FALSE");
}
return 1;
}
Use char-arrays to not waste your resources.
|
new bool:testboolean[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
testboolean[playerid] = false;
return 1;
}
CMD:test(playerid, params[])
{
testboolean[playerid] = true;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(testboolean[playerid] == true)
{
SendClientMessage(playerid, COLOR_RED, "TRUE");
}
else
{
SendClientMessage(playerid, COLOR_RED, "FALSE");
}
return 1;
}
new bool:testboolean[MAX_PLAYERS];
//changes into
new bool:testboolean[MAX_PLAYERS char];
//every
testboolean[playerid]
//changes into
testboolean{playerid}
forward Map1Loaded();
public Map1Loaded()
{
for( new i = 0; i < MAX_PLAYERS; i ++ )
{
TextDrawHideForPlayer(i, LoadingMap1);
TextDrawHideForPlayer(i, Map1Name);
TextDrawHideForPlayer(i, StripesMap1);
ShowPlayerDialog(i, DIALOG_TEAMSELECT, DIALOG_STYLE_LIST, "Choose your team", "Spetsnaz\nBlack Ops", "Choose", "");
SetPlayerPos(i, 1565.1692, -3558.5388, 52.3151);
SetCameraBehindPlayer(i);
TogglePlayerControllable(i, 1);
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if( newkeys & KEY_YES )
{
ShowPlayerDialog(playerid, DIALOG_CHOOSEGAME, DIALOG_STYLE_LIST, "Choose your gamemode...", "Team Deathmatch\nSearch and Destroy [SOON]\n-----------------------\n == Go to lobby ==", "Choose", "");
}
return 1;
}
if(response)
{
switch(dialogid)
{
case DIALOG_CHOOSEGAME:
{
switch(listitem)
{
case 0:
{
TogglePlayerControllable(playerid, 0);
SetPlayerCameraPos(playerid, 1471.0837, -3464.1860, 61.6439);
SetPlayerCameraLookAt(playerid, 1576.0729, -3625.4319, 3.4897);
TextDrawShowForPlayer(playerid, LoadingMap1);
TextDrawShowForPlayer(playerid, Map1Name);
TextDrawShowForPlayer(playerid, StripesMap1);
SetTimer("Map1Loaded", 7000, 0);
}
case 1:
{
ShowPlayerDialog(playerid, DIALOG_CHOOSEGAME, DIALOG_STYLE_LIST, "Choose your gamemode...", "Team Deathmatch\nSearch and Destroy [SOON]\n-----------------------\n == Go to lobby ==", "Choose", "");
}
case 2:
{
ShowPlayerDialog(playerid, DIALOG_CHOOSEGAME, DIALOG_STYLE_LIST, "Choose your gamemode...", "Team Deathmatch\nSearch and Destroy [SOON]\n-----------------------\n == Go to lobby ==", "Choose", "");
}
case 3:
{
SetPlayerPos(playerid, 2009.4140, 1017.8990, 994.4680);
}
}
}
}
}