SA-MP Forums Archive
Command help - 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: Command help (/showthread.php?tid=434306)



Command help - benjaminjones - 01.05.2013

pawn Код:
(71490) : error 017: undefined symbol "OrderX"
(71504) : error 017: undefined symbol "pGun1"
(71506) : error 017: undefined symbol "pGun2"
(71507) : error 017: undefined symbol "pGun2"
(71508) : error 017: undefined symbol "pGun3"
(71509) : error 017: undefined symbol "pGun4"
(71510) : error 017: undefined symbol "pGun6"
(71511) : error 017: undefined symbol "pGun2"
(71512) : error 017: undefined symbol "pGun5"
(71513) : error 017: undefined symbol "pGun5"
(71514) : error 017: undefined symbol "pGun3"
(71515) : error 017: undefined symbol "pGun6"
(71518) : error 017: undefined symbol "pGun11"
(71519) : error 017: undefined symbol "pGun11"
(71530) : error 017: undefined symbol "GivePlayerGun"
(71542) : error 017: undefined symbol "OrderX"
That's the command
pawn Код:
if(strcmp(cmd,"/order",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsAHitman(playerid))
            {
                if(IsPlayerInRangeOfPoint(playerid,3,OrderX, OrderY, OrderZ))
                {
                    tmp = strtok(cmdtext, idx);
                    if(!strlen(tmp))
                    {
                        SyntaxMessage(playerid, "/order [name]");
                        SendClientMessage(playerid, GREY1, "Rank 1: Knife ($800), Blindfold ($1,000), SDPistol ($1,000), Colt45 ($1,250), Shotgun ($1,500), MP5 ($2,500)");
                        SendClientMessage(playerid, GREY2, "Rank 2: Deagle ($5,000), Rifle ($3,000), AK47 ($10,000), M4 ($12,000), Vest ($15,000)");
                        SendClientMessage(playerid, GREY3, "Rank 3: SPAS12 ($35,000), Sniper ($35,000)");
                        SendClientMessage(playerid, GREY3, "Rank 4: C4 ($50,000), Nightvision ($2,000), Infared ($2,000), Mask ($35,000)");
                        SendClientMessage(playerid, GREY3, "Rank 5: Scope ($30,000)");
                        return 1;
                    }
                    new weapon, price;
                    if(strcmp(tmp,"knife",true) == 0) { if(PlayerInfo[playerid][pCash] > 799) { weapon = 4; price = 800; PlayerInfo[playerid][pGun1] = 4; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } }
                    else if(strcmp(tmp,"blindfold",true) == 0) { if(PlayerInfo[playerid][pCash] >= 1000) { price = 1000; PlayerInfo[playerid][pBlindfolds] += 3; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } }
                    else if(strcmp(tmp,"sdpistol",true) == 0) { if(PlayerInfo[playerid][pCash] > 999) { weapon = 23; price = 1000; PlayerInfo[playerid][pGun2] = 23; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } }
                    else if(strcmp(tmp,"colt45",true) == 0) { if(PlayerInfo[playerid][pCash] > 999) { weapon = 22; price = 1250; PlayerInfo[playerid][pGun2] = 22; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } }
                    else if(strcmp(tmp,"shotgun",true) == 0) { if(PlayerInfo[playerid][pCash] > 1499) { weapon = 25; price = 1500; PlayerInfo[playerid][pGun3] = 25; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } }
                    else if(strcmp(tmp,"mp5",true) == 0) { if(PlayerInfo[playerid][pCash] > 2499) { weapon = 29; price = 2500; PlayerInfo[playerid][pGun4] = 29; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } }
                    else if(strcmp(tmp,"rifle",true) == 0) { if(PlayerInfo[playerid][pRank] >= 2) { if(PlayerInfo[playerid][pCash] > 2999) { weapon = 33; price = 3000; PlayerInfo[playerid][pGun6] = 33; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 2."); return 1; } }
                    else if(strcmp(tmp,"deagle",true) == 0) { if(PlayerInfo[playerid][pRank] >= 2) { if(PlayerInfo[playerid][pCash] > 4999) { weapon = 24; price = 5000; PlayerInfo[playerid][pGun2] = 24; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 2."); return 1; } }
                    else if(strcmp(tmp,"ak47",true) == 0) { if(PlayerInfo[playerid][pRank] >= 2) { if(PlayerInfo[playerid][pCash] > 9999) { weapon = 30; price = 10000; PlayerInfo[playerid][pGun5] = 30; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 2."); return 1; } }
                    else if(strcmp(tmp,"m4",true) == 0) { if(PlayerInfo[playerid][pRank] >= 2) { if(PlayerInfo[playerid][pCash] > 11999) { weapon = 31; price = 12000; PlayerInfo[playerid][pGun5] = 31; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 2."); return 1; } }
                    else if(strcmp(tmp,"spas12",true) == 0) { if(PlayerInfo[playerid][pRank] >= 3) { if(PlayerInfo[playerid][pCash] > 34999) { weapon = 27; price = 35000; PlayerInfo[playerid][pGun3] = 27; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 3."); return 1; } }
                    else if(strcmp(tmp,"sniper",true) == 0) { if(PlayerInfo[playerid][pRank] >= 3) { if(PlayerInfo[playerid][pCash] > 34999) { weapon = 34; price = 35000; PlayerInfo[playerid][pGun6] = 34; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 3."); return 1; } }
                    else if(strcmp(tmp,"c4",true) == 0) { if(PlayerInfo[playerid][pRank] >= 4) { if(PlayerInfo[playerid][pCash] >= 50000) { price = 50000; PlayerInfo[playerid][pBombs] += 1; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 4."); return 1; } }
                    else if(strcmp(tmp,"mask",true) == 0) { if(PlayerInfo[playerid][pRank] >= 4) { if(PlayerInfo[playerid][pCash] >= 35000) { price = 35000; HasBoughtMask[playerid] = 1; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 4."); return 1; } }
                    else if(strcmp(tmp,"nightvision",true) == 0) { if(PlayerInfo[playerid][pRank] >= 4) { if(PlayerInfo[playerid][pCash] > 1999) { weapon = 44; price = 2000; PlayerInfo[playerid][pGun11] = 44; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 4."); return 1; } }
                    else if(strcmp(tmp,"infared",true) == 0) { if(PlayerInfo[playerid][pRank] >= 4) { if(PlayerInfo[playerid][pCash] > 1999) { weapon = 45; price = 2000; PlayerInfo[playerid][pGun11] = 45; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 4."); return 1; } }
                    else if(strcmp(tmp,"vest",true) == 0) { if(PlayerInfo[playerid][pRank] >= 2) { if(PlayerInfo[playerid][pCash] >= 15000) { price = 15000; SetPlayerArmour(playerid, 100); } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 2."); return 1; } }
                    else if(strcmp(tmp,"scope",true) == 0) { if(PlayerInfo[playerid][pRank] >= 5) { if(PlayerInfo[playerid][pCash] >= 30000) { price = 30000; PlayerInfo[playerid][pScope] = 1; } else { SendClientMessage(playerid,GREY, "    You cannot afford that."); return 1; } } else { SendClientMessage(playerid,GREY, "    You must be atleast Rank 5."); return 1; } }
                    else
                    {
                        SendClientMessage(playerid,GREY,"Invalid weapon name.");
                        return 1;
                    }
                    GiveMoney(playerid, -price);
                    if(weapon != 0)
                    {
                        GivePlayerGun(playerid, weapon);
                    }
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    format(string, sizeof(string), "* You have purchased a %s for $%d.", tmp, price);
                    SendClientMessage(playerid, LIGHTBLUE, string);
                }
                else
                {
                    SendClientMessage(playerid, GREY, "    You are not at your headquarters.");
                    if(CP[playerid] == 0)
                    {
                        SendClientMessage(playerid, GREY, "The headquarters have been marked on your map.");
                        SetPlayerCheckpoint(playerid,OrderX,OrderY,OrderZ,4);
                        CP[playerid] = 12;
                    }
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, GREY, "    You are not a Member of the Hitman Agency.");
                return 1;
            }
        }
        return 1;
    }
Where's the problem eh?


Re: Command help - Jay_Dixon - 01.05.2013

Try it like this, ofcourse the code thing shot it out wrong, but yeah, it's worth a try, if you make it a gui, that way there's more you can do with it, and it's simpler to work with. Also the IsAHitman wouldn't be needed, you can literally faction id lock that cmd, if you need to know more about that, tell me, i'll prolly even throw together an order cmd for you

Код:
	if(strcmp,cmd,"/order",true == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(IsAHitman(playerid))
	        {
	            if(IsPlayerInRnageOfPoint(playerid,coords go here)
	            {
	                ShowPlayerDialog(playerid, 310, DIALOG_STYLE_LIST, "Hitman order","Guns\nGuns\nGuns\n");
				}
			}
		}
		return 1;
	}
	
	
	
	if(dialogid == 310)
	{
	    if(response)
	    {
	        switch(listitem)
	        {
	            case 0:
	            {
	                if(PlayerInfo[playerid][pRank] >= 1)
	                {
	                    GivePlayerWeaponEx(playerid, 22 25);
	                    GivePlayerMoneyEx(playerid, -1500)
	                    return 1;
					}
				}
				case 1:
				{
					if(PlayerInfo[playerid][pRank] >= 1)
					{
						you see what i'm doing?
						return 1;
					}
				}
			}
		}
	}



Re: Command help - benjaminjones - 01.05.2013

I need to fix this command buddy I'm gonna give you rep because you tried to help


Re: Command help - ethhackerman - 01.05.2013

new Floatrderx, Floatrdery, Floatrderz;
did you try to do it?


Re: Command help - Jay_Dixon - 02.05.2013

Quote:
Originally Posted by benjaminjones
Посмотреть сообщение
I need to fix this command buddy I'm gonna give you rep because you tried to help
Awesome, i can try to help if you need