Weapon spawning problem!
#1

I have weapon spawning problem.. I got no errors but when i try spawn a weapons, nothing happends

Код:
    if (strcmp("/weapons", cmdtext, true)==0)
 	{
	    ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Weapons","1.AK-47\n2.M4\n3.Tec9\n4.Desert Eagle\n5.Combat Shotgun\n6.Minigun\n7.Sniper Rifle\n8.Chainsaw","Buy","Exit");
		return 1;
	}

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	
	if(dialogid==2)
		{
			if(response==1)
			{
				if(listitem==1)
				{
				GivePlayerWeapon(playerid,355,200);
				}
				
				
				if(listitem==2)
				{
				GivePlayerWeapon(playerid,356,200);
				}
				
				
				
				if(listitem==3)
				{
				GivePlayerWeapon(playerid,372,200);
				}
				
				
				if(listitem==4)
				{
				GivePlayerWeapon(playerid,348,200);
				}
				
				
				
				if(listitem==5)
				{
				GivePlayerWeapon(playerid,351,200);
				}
				
				
				
				if(listitem==6)
				{
				GivePlayerWeapon(playerid,362,200);
				}
				
				
				
				if(listitem==7)
				{
				GivePlayerWeapon(playerid,358,200);
				}
				
				
				if(listitem==8)
				{
				GivePlayerWeapon(playerid,341,200);
				}
			}
		}
		return 1;
	}
Please, tell me whats wrong
Reply
#2

Show us Errors?
Reply
#3

Quote:
Originally Posted by Roomeo
Посмотреть сообщение
Show us Errors?
Quote:
Originally Posted by kemppis_
Посмотреть сообщение
I have weapon spawning problem.. I got no errors but when i try spawn a weapons, nothing happends
Dude srsly. READ BEFORE POSTING!
Reply
#4

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 2)
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid,355,200);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid,356,200);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid,372,200);
            }
            if(listitem == 3)
            {
                GivePlayerWeapon(playerid,348,200);
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid,351,200);
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid,362,200);
            }
            if(listitem == 6)
            {
                GivePlayerWeapon(playerid,358,200);
            }
            if(listitem == 7)
            {
                GivePlayerWeapon(playerid,341,200);
            }
        }
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Roomeo
Посмотреть сообщение
Show us Errors?
Код:
C:\Users\****\Desktop\Spawn.pwn(118) : warning 217: loose indentation
C:\Users\****\Desktop\Spawn.pwn(119) : warning 202: number of arguments does not match definition
C:\Users\****\Desktop\Spawn.pwn(121) : warning 202: number of arguments does not match definition
C:\Users\****\Desktop\Spawn.pwn(373) : warning 217: loose indentation
Line 118 -> new vehicleid = GetPlayerVehicleID(playerid);
Line 119 -> SendClientMessage(playerid, COLOR_YELLOW, "You repaired vehicle ID: %d.", vehicleid);
Line 121 -> GetPlayerMoney(playerid, 100); //SHOULD take 100$ for repairing car
Line 373 -> return 1;
Reply
#6

Clive: Still not working ://
Reply
#7

Perhaps try this:
Код:
		if (strcmp(cmdtext, "/weapons", true)==0)
		{
	    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Weapons","1.AK-47\n2.M4\n3.Tec9\n4.Desert Eagle\n5.Combat Shotgun\n6.Minigun\n7.Sniper Rifle\n8.Chainsaw","Purchase","Close");
		return 1;
	}
Код:
	public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
	{
		if(dialogid == 2)
		{
			if(response)
			{
				if(listitem==0)
				{
				GivePlayerWeapon(playerid,355,200);
				}
				
				
				if(listitem==1)
				{
				GivePlayerWeapon(playerid,356,200);
				}
				
				
				
				if(listitem==2)
				{
				GivePlayerWeapon(playerid,372,200);
				}
				
				
				if(listitem==3)
				{
				GivePlayerWeapon(playerid,348,200);
				}
				
				
				
				if(listitem==4)
				{
				GivePlayerWeapon(playerid,351,200);
				}
				
				
				
				if(listitem==5)
				{
				GivePlayerWeapon(playerid,362,200);
				}
				
				
				
				if(listitem==6)
				{
				GivePlayerWeapon(playerid,358,200);
				}
				
				
				if(listitem==7)
				{
				GivePlayerWeapon(playerid,341,200);
				}
			}
		}
		return 1;
	}
Reply
#8

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 2)
    {
                if(!response) return 0;
                if(listitem == 0)
            {
                GivePlayerWeapon(playerid,355,200);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid,356,200);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid,372,200);
            }
            if(listitem == 3)
            {
                GivePlayerWeapon(playerid,348,200);
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid,351,200);
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid,362,200);
            }
            if(listitem == 6)
            {
                GivePlayerWeapon(playerid,358,200);
            }
            if(listitem == 7)
            {
                GivePlayerWeapon(playerid,341,200);
            }
        }
    }
    return 1;
}
Reply
#9

I've given you the working code and Tested no Errors.

Try that again.
Reply
#10

Clive, It just doesn't work :-O

Please, check if it's right? http://pastebin.com/abmppKFh
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)