SA-MP Forums Archive
One cmd for two checkpoints - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: One cmd for two checkpoints (/showthread.php?tid=177888)



One cmd for two checkpoints - nejc001 - 19.09.2010

this script is not right
I just show you the important things in script
Код:
new weapondealer; //variable, could be helpful for this script
    if(weapondealer == 0) //could be helpful for this script
    weapondealer   = 0; //could be helpful for this script

	if(!strcmp("/buyweapons1", cmdtext,true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 2.0, 2817.7190,-1168.5554,1025.5778))return    SendClientMessage(playerid, 0xFF9900AA,"You are not in /buyweapons1 checkpoint.");
        ShowMenuForPlayer(weaponmenu,playerid);
        return 1;
        }
    

if(!strcmp("/buyweapons2", cmdtext,true))
    {
     if(!IsPlayerInRangeOfPoint(playerid, 2.0, 2450.6052,-1694.2794,1013.5152))return SendClientMessage(playerid, 0xFF9900AA,"You are not in /buyweapons2 checkpoint.");
        ShowMenuForPlayer(weaponmenu,playerid);
        return 1;
        }
How to make from this two scripts just one script ( /buyweapons)?


Re: One cmd for two checkpoints - Vince - 19.09.2010

pawn Код:
new weapondealer; //variable, could be helpful for this script
    if(weapondealer == 0) //could be helpful for this script
    weapondealer   = 0; //could be helpful for this script
Makes no sense at all. You create a variable with a value of 0, then check if it is 0 and then you set it to 0 again.

pawn Код:
if(!strcmp("/buyweapons", cmdtext,true))
{
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, 2817.7190,-1168.5554,1025.5778)
    && !IsPlayerInRangeOfPoint(playerid, 2.0, 2450.6052,-1694.2794,1013.5152))
        return SendClientMessage(playerid, 0xFF9900AA,"You are not in /buyweapons checkpoint.");
       
    ShowMenuForPlayer(weaponmenu,playerid);
    return 1;
}



Re: One cmd for two checkpoints - nejc001 - 19.09.2010

lol && -.-'
i need to read somewhere, what this signs means in pawno.

I was thinking to solve this with a variable, it doesnt make any sense in the script i posted here, cuz i wanted like that. -.-'
ty for help


Re: One cmd for two checkpoints - Vince - 19.09.2010

Quote:
Originally Posted by nejc001
Посмотреть сообщение
lol && -.-'
i need to read somewhere, what this signs means in pawno.
https://sampwiki.blast.hk/wiki/Control_Structures#Operators