help with bools.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help with bools.. (
/showthread.php?tid=400647)
help with bools.. -
karolis1478 - 19.12.2012
Hi, I have problem with bools, everybody knows whom they are intended
this is a script:
pawn Код:
#define IsAnywhere(%0) \
( InDrag [ %0 ], InStunt [ %0 ] )
#define IsAnywhere2(%0) \
( InDm [ %0 ], inpstunt [ %0 ] )
#define IsAnywhere3(%0) \
( infura [ %0 ], infura2 [ %0 ] )
#define IsAnywhere4(%0) \
( inairplane [ %0 ] )
//----------------------ZONU-BOOLAI---------------------------------------------
new bool: inpstunt[MAX_PLAYERS];
new bool:infura[MAX_PLAYERS];
new bool:infura2[MAX_PLAYERS];
new bool:inairplane[MAX_PLAYERS];
new bool:InDm[MAX_PLAYERS];
new bool:InStunt[MAX_PLAYERS];
and when y type /stunt ( or other cmd ) then set my pos in the zone and so on, and in the command is inserted
but its a big bug. this is /player command:
pawn Код:
dcmd_player(playerid, params[])
{
#pragma unused params
if ( !IsAnywhere ( playerid ) || !IsAnywhere2 (playerid) || !IsAnywhere3 (playerid) || !IsAnywhere4 (playerid) ) return GameTextForPlayer(playerid,"Jus niekur nesate prisijunges.", 4000, 4);
return GameTextForPlayer(playerid,"~g~you are not logged in anywhere", 4000, 4);
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
SetPlayerVirtualWorld(playerid, 0);
InDrag[playerid] = false;
InDm[playerid] = false;
InStunt[playerid] = false;
inpstunt[playerid] = false;
infura[playerid] = false;
infura2[playerid] = false;
inairplane[playerid] = false;
TextDrawHideForPlayer(playerid, stunttd);
TextDrawHideForPlayer(playerid, DMtd);
DisablePlayerRaceCheckpoint(playerid);
sInfo[playerid][pSTUNT] = 0;
sInfo[playerid][fura] = 0;
sInfo[playerid][fura2] = 0;
sInfo[playerid][airplane] = 0;
DisablePlayerCheckpoint(playerid);
SpawnPlayer(playerid);
}
else
{
SetPlayerVirtualWorld(playerid, 0);
sInfo[playerid][pSTUNT] = 0;
sInfo[playerid][fura] = 0;
sInfo[playerid][fura2] = 0;
sInfo[playerid][airplane] = 0;
SetPlayerVirtualWorld(playerid, 0);
InDrag[playerid] = false;
InDm[playerid] = false;
InStunt[playerid] = false;
inpstunt[playerid] = false;
infura[playerid] = false;
infura2[playerid] = false;
inairplane[playerid] = false;
TextDrawHideForPlayer(playerid, stunttd);
TextDrawHideForPlayer(playerid, DMtd);
DisablePlayerRaceCheckpoint(playerid);
DisablePlayerCheckpoint(playerid);
SpawnPlayer(playerid);
}
return 1;
}
and in this command and when I wrote, I wrote that I am not logged in anywhere.
and I did check with cmd:
pawn Код:
if(strcmp(cmdtext,"/checking",true)==0)
{
if ( !IsAnywhere ( playerid ) || !IsAnywhere2 (playerid) || !IsAnywhere3 (playerid) || !IsAnywhere4 (playerid) )
{
SendClientMessage(playerid, COLOR_RED," you are not in the zone");
}
else if ( IsAnywhere ( playerid ) || IsAnywhere2 (playerid) || IsAnywhere3 (playerid) || IsAnywhere4 (playerid) )
{
SendClientMessage(playerid, COLOR_GREEN," you are in the zone.");
}
return 1;
}
and when i in the zone t.y. ( InStunt[playerid] == true; ) and send command /checking, server wrote that i am not in the zone, where is a bug? help
Re: help with bools.. -
karolis1478 - 19.12.2012
someone... help