Easy Question about /GiveWeapon
#8

Код:
CMD:giveweapon(playerid, params[])
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /giveweapon[playerid/PartOfName] [weaponid(eg. 46 = Parachute)] [ammo]");
				return 1;
			}
			new playa;
			new gun;
			new ammo;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			gun = strval(tmp);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /giveweapon [playerid/PartOfName] [weaponid] [ammo]");
				SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
				SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
				return 1;
			}
			if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==19||gun==20||gun==21||gun==36||gun==39||gun==40||gun==44||gun==45)
			{ SendClientMessage(playerid, COLOR_GRAD1, "   wrong WeaponID!"); return 1; }
			tmp = strtok(cmdtext, idx);
			ammo = strval(tmp);
			if(ammo <1||ammo > 999)
			{ SendClientMessage(playerid, COLOR_GRAD1, "   dont go below 1 or above 999 bullets!"); return 1; }
			if(!IsPlayerAdmin(playerid))			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						GivePlayerWeapon(playa, gun, ammo);
						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, 256, "News: %s has given %s gun id %d.", giveplayer,sendername,gun);
						ABroadCast(COLOR_YELLOW,string,1);

					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
			}
		}
		return 1;
	}
Код:
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(657) : error 017: undefined symbol "tmp"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(657) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(658) : error 017: undefined symbol "tmp"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(666) : error 017: undefined symbol "ReturnUser"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : error 017: undefined symbol "tmp"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(668) : error 017: undefined symbol "tmp"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(669) : error 017: undefined symbol "tmp"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(678) : error 017: undefined symbol "tmp"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(678) : error 017: undefined symbol "strtok"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(679) : error 017: undefined symbol "tmp"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(688) : error 017: undefined symbol "giveplayer"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(688) : error 017: undefined symbol "giveplayer"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(688) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(688) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


15 Errors.
Reply


Messages In This Thread
Easy Question about /GiveWeapon - by Alexy_Dramon - 17.03.2012, 14:06
Re: Easy Question about /GiveWeapon - by Dan_Barocu - 17.03.2012, 14:10
Re: Easy Question about /GiveWeapon - by Faisal_khan - 17.03.2012, 14:11
Re: Easy Question about /GiveWeapon - by Alexy_Dramon - 17.03.2012, 14:11
Re: Easy Question about /GiveWeapon - by Dan_Barocu - 17.03.2012, 14:13
Re: Easy Question about /GiveWeapon - by Alexy_Dramon - 17.03.2012, 14:21
Re: Easy Question about /GiveWeapon - by Dan_Barocu - 17.03.2012, 14:24
Re: Easy Question about /GiveWeapon - by Alexy_Dramon - 17.03.2012, 14:29
Re: Easy Question about /GiveWeapon - by ReneG - 17.03.2012, 14:31
Re: Easy Question about /GiveWeapon - by Alexy_Dramon - 17.03.2012, 14:33

Forum Jump:


Users browsing this thread: 3 Guest(s)