02.08.2014, 03:34
( I Just started learning pawno, so I'm a Beginner. )
I made /whereismech command that creates a checkpoint at the mechanic place, So What I want is: If the player has already another checkpoint he won't be able to /whereismech, he needs to delete the first one. So I thought about creating a boolean that conatins (false) and after using a checkpoint command the boolean gets a (true) , but as I said I'm new and maybe it's not a good Idea but here is what I tried to do:
I made /whereismech command that creates a checkpoint at the mechanic place, So What I want is: If the player has already another checkpoint he won't be able to /whereismech, he needs to delete the first one. So I thought about creating a boolean that conatins (false) and after using a checkpoint command the boolean gets a (true) , but as I said I'm new and maybe it's not a good Idea but here is what I tried to do:
pawn Код:
new bool: Bo;
Bo=false;
pawn Код:
if (strcmp(cmdtext, "/whereismech", true) == 0)
{
if (Bo == true) return SendClientMessage(playerid, 0xFF0000AA, "You already have an active Checkpoint, use /deletecheckpoint to have another");
else
{
if (!IsPlayerInRangeOfPoint(playerid, 5, 1607.2327, -1841.8683, 13.5116))
{
SetPlayerCheckpoint(playerid, 1607.2327, -1841.8683, 13.5116, 3);
SendClientMessage (playerid, 0xFF0000AA, "Go to the checkpoint and /repair there");
Bo = true;
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are already in the mechanic place, use /repair, this will cost you 5000$");
return 1;
}
}
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
PlayerPlaySound(playerid, 1139, 0.0, 0.0, 0.0);
Bo=false;
return 1;
}
Quote:
(171) : error 017: undefined symbol "Bo" (182) : error 017: undefined symbol "Bo" (182) : warning 215: expression has no effect (219) : error 017: undefined symbol "Bo" (219) : warning 215: expression has no effect Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors. |