SA-MP Forums Archive
Pawno stopt working - 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: Pawno stopt working (/showthread.php?tid=361879)



Pawno stopt working - McFellow - 22.07.2012

Hello,
When im trying to compile something that I scripted it says Pawno stop working im making this
pawn Код:
if(dialogid == RIMSMENU)
    {
        if ( response )
        {
            switch ( listitem )
            {
                case 0:
                {
                if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
                AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
                }
                return SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
                }
                case 1:
                {
                if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
                AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
                }
                return SendClientMessage(playerid, 0xFFFFFFFF, "You have added Cutter Rims to your vehicle.");
            }
        }
    }
If you are in a car and your admin if you do /rims then a you will see an menu Gold rims or Cutter rims
Who helped me will get REP


Re: Pawno stopt working - McFellow - 22.07.2012

pawn Код:
CMD:rims(playerid, params[])
{
    ShowPlayerDialog(playerid, RIMSMENU, DIALOG_STYLE_LIST, "Rims", "Golden Rims\nCutter Rims", "OK", "CANCEL");
    return 1;
}
This is the CMD


Re: Pawno stopt working - Pinguinn - 22.07.2012

You were missing a bracket
pawn Код:
if(dialogid == RIMSMENU)
    {
        if ( response )
        {
            switch ( listitem )
            {
                case 0:
                {
                    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
                    AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
                    return SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
                }
               
                case 1:
                {
                    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
                    AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
                    return SendClientMessage(playerid, 0xFFFFFFFF, "You have added Cutter Rims to your vehicle.");
                }
            }
        }
    }



Re: Pawno stopt working - Jessyy - 22.07.2012

Try this: ... next tine read here about "switch" https://sampwiki.blast.hk/wiki/Control_Structures#switch_2
Код:
    if(dialogid == RIMSMENU)
    {
        if ( response )
        {
            switch ( listitem )
            {
                case 0:
                {
                    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
                        SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
                    } else {
                        AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
                        SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
                    }
                }
                
                case 1:
                {
                    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
                        SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
                    } else {
                        AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
                        SendClientMessage(playerid, 0xFFFFFFFF, "You have added Cutter Rims to your vehicle.");
                    }
                }
            }
        }
    }



Re: Pawno stopt working - McFellow - 22.07.2012

Pinguing I don't get the message any more that it stopt working but I get this error 26 times
Код:
error 017: undefined symbol "ProxDetector"



Re: Pawno stopt working - McFellow - 22.07.2012

Quote:
Originally Posted by Jessyy
Посмотреть сообщение
Try this: ... next tine read here about "switch" https://sampwiki.blast.hk/wiki/Control_Structures#switch_2
Код:
    if(dialogid == RIMSMENU)
    {
        if ( response )
        {
            switch ( listitem )
            {
                case 0:
                {
                    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
                        SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
                    } else {
                        AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
                        SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
                    }
                }
                
                case 1:
                {
                    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) {
                        SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
                    } else {
                        AddVehicleComponent(GetPlayerVehicleID(playerid),1079);
                        SendClientMessage(playerid, 0xFFFFFFFF, "You have added Cutter Rims to your vehicle.");
                    }
                }
            }
        }
    }
Now I have 26 times this error
Код:
error 017: undefined symbol "ProxDetector"



Re: Pawno stopt working - McFellow - 22.07.2012

Any one other idea's?


Re: Pawno stopt working - McFellow - 22.07.2012

Some one?