Peršokti į turinį

Pagalbos su pawn


Recommended Posts

Sveiki, scriptinu ir nesuprantu kodel man praskipina puse komandu help.

f978cb84f087d749db202bfc08fae8aa.png.a601e5138971918d0132b122439be287.png

If(GetPlayerMoney(playerid) >= 1000) Sita komanda isvis praskipina, o toliau parenka armourus ir zinute "You don't have enough money". O kitu likusiu 2 komandu net nerodo GivePlayerMoney(playerid, -1000); ir SendClientMessage(playerid, -1, "{0c7000}You successfully bought armour for 1000$");

Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

Nesu pro ar dar ka┼żk─ů: bet ar netur─Śt┼│ b┼źt┬á

GivePlayerMoneyA, GetPlayerMoneyA funkcijos

 

o kod─Śl tiek daug return 1; naudoji po kiekvienu, ar ─Źia vietoj else ka┼żkaip ? :D

 

be to:

If(GetPlayerMoney(playerid) >= 1000)

┬áne taip tur─Śt┼│ b┼źt

If(GetPlayerMoney(playerid) <= 1000)

Redaguota , nario Graphic
  • Teigiamai 2
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

Tr┼źksta else{}

Nescriptinu sampui, bet man atrodo taip tur─Śt┼│ b┼źt.

public OnPlayerPickUpPickup(playerid, pickupid) 
{
	if(pickupid == GroveArmourPickup) {
		if(Gang[playerid] == 1) {
			if(GetPlayerMoney(playerid) >= 1000) {
				SendClientMessage(playerid, -1, "{0c7000}You succesfully bought armour for 1000$");
				SetPlayerArmour(playerid, 100.0);
				GivePlayerMoney(playerid, -1000);
			}
			else {
				SendClientMessage(playerid, -1, "{FF0000}You don't have enough money!");
			}
		}
		else {
			SendClientMEssage(playerid, -1, "{FF0000} You can't buy armor from other gang!");
		}
	}
	return 1;
}

 

  • Teigiamai 1
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

if(pickupid == GroveArmourPickup)
{
     if(Gang[playerid] != 1) return SendClientMessage(playerid, -1, "You can't buy armor from other gang!");
     if(GetPlayerMoney(playerid) > 1000) return SendClientMessage(playerid, -1, "You don't have enough money!");
     SendClientMessage(playerid, -1, "{0c7000}You succesfully bought armour for 1000$");
    
     SetPlayerArmour(playerid, 100);
     GivePlayerMoney(playerid, -1000);
     return 1;
}

Naudok, šitas veiks.

  • Teigiamai 1
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

(redaguota)

Dekui kad bandot padet bet zinokit neivienas neveikia, ieini i pickup ir turedamas 0$ gauni armour.

 

Manau, kad sita eilute visiskai neveikia:
if(GetPlayerMoney(playerid) >= 1000) {

 

Atsiprasau kad neidejau kodo: 

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == GroveArmourPickup)
    {
        if(Gang[playerid] == 1)
        {
              if(GetPlayerMoney(playerid) >= 1000)
              {
                SendClientMessage(playerid, -1, "{0c7000}You successfully bought armour for 1000$");
                SetPlayerArmour(playerid, 100.0);
                GivePlayerMoney(playerid, -1000);
                return 1;
            }
            SendClientMessage(playerid, -1, "{FF0000}You don't have enough money!");
            return 1;
        }
        SendClientMessage(playerid, -1, "{FF0000}You can't buy armour from other gang!");
        return 1;
    }
    return 1;
}

Redaguota , nario Liquid'
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

public OnPlayerPickUpPickup(playerid, pickupid) 
{
	if(pickupid == GroveArmourPickup)
	{
		if(Gang[playerid] == 1)
		{
			if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1, "{FF0000}You don't have enough money!");
			SendClientMessage(playerid, -1, "{0c7000}You succesfully bought armour for 1000$");
			SetPlayerArmour(playerid, 100.0);
			GivePlayerMoney(playerid, -1000);
         		return 1;
		}
		else return SendClientMessage(playerid, -1, "{FF0000} You can't buy armor from other gang!");
	}
	return 1;
}

 

Redaguota , nario MantasPwn
  • Teigiamai 1
Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

11 minutes prie┼í, MantasPwn para┼í─Ś:
public OnPlayerPickUpPickup(playerid, pickupid) 
{
	if(pickupid == GroveArmourPickup)
	{
		if(Gang[playerid] == 1)
		{
			if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1, "{FF0000}You don't have enough money!");
			SendClientMessage(playerid, -1, "{0c7000}You succesfully bought armour for 1000$");
			SetPlayerArmour(playerid, 100.0);
			GivePlayerMoney(playerid, -1000);
         		return 1;
		}
		else return SendClientMessage(playerid, -1, "{FF0000} You can't buy armor from other gang!");
	}
	return 1;
}

 

Same shit, tik dabar nueini i -1000 nes zenklas ne i ta puse

Nuoroda ─» komentar─ů
Dalintis per kit─ů puslap─»

Sve─Źias
┼ái tema yra u┼żrakinta.
  • ┼áiame puslapyje nar┼ío:   0 nariai

    • N─Śra registruot┼│ nari┼│ per┼żi┼źrin─Źi┼│ ┼í─» forum─ů.

├Ś
├Ś
  • Sukurti nauj─ů...