Need correction[rep]
#1

Can someone correct this dialog?
pawn Код:
case DIALOG_WEAPONS:
        {
            if( response )
            {
                switch( listitem )
                {
                    case 0:
                 {
    if( response )
    {
        if(GetPlayerMoney(playerid) <= 1000) || GetPlayerMoney(playerid) -1000);
        {
            echo(playerid,COLOR_DARKRED,"You have not enough money!");
        }
        else
        {
            GivePlayerWeapon(playerid, WEAPON_MP5, 50);
            echo(playerid,COLOR_BLUE,"You baught a MP5 with 50 rounds of ammo!");
        }
    }
The problem is GetPlayerMoney,

thanks
Reply
#2

pawn Код:
case DIALOG_WEAPONS:
        {
            if( response )
            {
                switch( listitem )
                {
                    case 0:
                 {
    if( response )
    {
        if(GetPlayerMoney(playerid) < 1000));
        {
            SendClientMessage(playerid,COLOR_DARKRED,"You have not enough money!");
        }
        else
        {
            GivePlayerWeapon(playerid, WEAPON_MP5, 50);
            SendClientMessage(playerid,COLOR_BLUE,"You baught a MP5 with 50 rounds of ammo!");
        }
    }
Reply
#3

I don't really know what's wrong, but try it with GivePlayerMoney....

PHP код:
if(GetPlayerMoney(playerid) <= 1000) || GivePlayerMoney(playerid) -1000); 
Could you explain what the exactly error is if it didn't work?
Reply
#4

if(GetPlayerMoney(playerid) <= 1000) || GetPlayerMoney(playerid) -1000);

would be

if(GetPlayerMoney(playerid) <= 1000)

Then you would use GivePlayerMoney(playerid, -1000); where you gave them the weapon.
Reply
#5

Weird why it is not working.. here the error list:
pawn Код:
C:\Users\Nick\Desktop\Call Of Duty - Engine SA-MP\gamemodes\Untitled.pwn(357) : error 029: invalid expression, assumed zero
C:\Users\Nick\Desktop\Call Of Duty - Engine SA-MP\gamemodes\Untitled.pwn(357) : warning 202: number of arguments does not match definition
C:\Users\Nick\Desktop\Call Of Duty - Engine SA-MP\gamemodes\Untitled.pwn(357) : warning 215: expression has no effect
C:\Users\Nick\Desktop\Call Of Duty - Engine SA-MP\gamemodes\Untitled.pwn(357) : error 001: expected token: ";", but found ")"
C:\Users\Nick\Desktop\Call Of Duty - Engine SA-MP\gamemodes\Untitled.pwn(357) : error 029: invalid expression, assumed zero
C:\Users\Nick\Desktop\Call Of Duty - Engine SA-MP\gamemodes\Untitled.pwn(357) : fatal error 107: too many error messages on one line
Reply
#6

Show us the line with the errors and warnings, dude!
Reply
#7

Why you have 2x "if(response)" ??

pawn Код:
case DIALOG_WEAPONS:
        {
            if( response )
            {
                switch( listitem )
                {
                    case 0:
                    {
                            if(GetPlayerMoney(playerid) <= 1000);
                            {
                                echo(playerid,COLOR_DARKRED,"You have not enough money!");
                            }
                            else
                            {
                                GivePlayerWeapon(playerid, WEAPON_MP5, 50);
                                echo(playerid,COLOR_BLUE,"You baught a MP5 with 50 rounds of ammo!");
                            }
                    }
Reply
#8

Idk, but if response is not the problem. The problem is GetplayerMoney, I want to check if a player has 1.000 money and then I want get 1.000 from the player.

Seems like this.
pawn Код:
if GetPlayerMoney(playerid)=< 1000) || GetPlayerMoney(playerid) == -1000);
Reply
#9

You forgot a rounded bracket, I think, see?

Your code:

if GetPlayerMoney(playerid)=< 1000) || GetPlayerMoney(playerid) == -1000);


Try this, but I don't think that this is the error....Maybe 1 of them...

if(( GetPlayerMoney(playerid)=< 1000) || GetPlayerMoney(playerid) == -1000);
Reply
#10

Quote:
Originally Posted by smokeweed
Посмотреть сообщение
Idk, but if response is not the problem. The problem is GetplayerMoney, I want to check if a player has 1.000 money and then I want get 1.000 from the player.

Seems like this.
pawn Код:
if GetPlayerMoney(playerid)=< 1000) || GetPlayerMoney(playerid) == -1000);
Oooh, Try this:

pawn Код:
if(GetPlayerMoney(playerid) >= 1000)
{
SetPlayerMoney(playerid,GetPlayerMoney(playerid)-1000);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)