SA-MP Forums Archive
Errors please help! - 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: Errors please help! (/showthread.php?tid=513195)



Errors please help! - rockhopper - 15.05.2014

Код:
error 029: invalid expression, assumed zero
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
 fatal error 107: too many error messages on one line
All this on one line that is
Код:
if(GetPlayerTeam(playerid) == TEAM_CIVILIANS)
{
SetPlayerPos(playerid, 1171.4133,-1308.4025,13.9918);
SetPlayerColor(playerid, TEAM_CIVILIANS_COLOR);
SendClientMessage(playerid, COLOR_GREEN,"PLEASE CHOOSE A SKILL");
THIS LINE==ShowPlayerDialog(playerid, DIALOG_SKILL , DIALOG_STYLE_LIST, "Please Choose a skill", "Rapist\nPickPocket\nMechanic\nHitman\nWeaponDealer\nDrugDealer", "Choose", "Cancel");
}



Re: Errors please help! - rockhopper - 15.05.2014

Please help


Re: Errors please help! - Lynn - 15.05.2014

Are you sure that's the right line? Because that code works.


Re: Errors please help! - rockhopper - 15.05.2014

Yes that's the line it was working for me but now suddenly its not working ....
Should i give my whole OnPlayerSpawn ??


Re: Errors please help! - superrobot48 - 15.05.2014

Show us where u assign the team_civillians plz


Re: Errors please help! - rockhopper - 15.05.2014

Here
Код:
public OnPlayerSpawn(playerid)
{
if(GetPlayerTeam(playerid) == TEAM_COPS) 
{
SetPlayerPos(playerid, 1565.7843,-1694.2400,5.8906);
SetPlayerColor(playerid, TEAM_COPS_COLOR);
}

if(GetPlayerTeam(playerid) == TEAM_CIVILIANS)
{
SetPlayerPos(playerid, 1171.4133,-1308.4025,13.9918);
SetPlayerColor(playerid, TEAM_CIVILIANS_COLOR);
ShowPlayerDialog(playerid, DIALOG_SKILL , DIALOG_STYLE_LIST, "Please Choose a skill", "Rapist\nPickPocket\nMechanic\nHitman\nWeaponDealer\nDrugDealer", "Choose", "Cancel");
}

if(GetPlayerTeam(playerid) == TEAM_RAPIST)
{
SetPlayerPos(playerid, 1171.4133,-1308.4025,13.9918);
SetPlayerColor(playerid, COLOR_GHOSTWHITE);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,5,1,17,3,22,100,41,200);
}

if(GetPlayerTeam(playerid) == TEAM_PICKPOCKET)
{
SetPlayerPos(playerid, 1171.4133,-1308.4025,13.9918);
SetPlayerColor(playerid, COLOR_GHOSTWHITE);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,15,1,22,200,29,200);
}

if(GetPlayerTeam(playerid) == TEAM_MECHANIC)
{
SetPlayerPos(playerid, 1171.4133,-1308.4025,13.9918);
SetPlayerColor(playerid, COLOR_GHOSTWHITE);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,10,1,11,1,12,1,13,1);
}

if(GetPlayerTeam(playerid) == TEAM_HITMAN)
{
SetPlayerPos(playerid, 1171.4133,-1308.4025,13.9918);
SetPlayerColor(playerid, COLOR_GHOSTWHITE);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,4,1,23,200,25,75,34,50);
}

if(GetPlayerTeam(playerid) == TEAM_WEAPONDEALER)
{
SetPlayerPos(playerid, 1171.4133,-1308.4025,13.9918);
SetPlayerColor(playerid, COLOR_GHOSTWHITE);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,24,50,26,20,32,100,30,200);
}

if(GetPlayerTeam(playerid) == TEAM_DRUGDEALER)
{
SetPlayerPos(playerid, 1171.4133,-1308.4025,13.9918);
SetPlayerColor(playerid, COLOR_GHOSTWHITE);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,24,50,32,100,30,200);
}

return 1;
}
This is my whole on player spawn ...
getting error there only !


Re: Errors please help! - rockhopper - 15.05.2014

Please help


Re: Errors please help! - AroseKhanNiazi - 15.05.2014

everything fine
pawn Код:
DIALOG_SKILL
show it's define and ondialogresponse


Re: Errors please help! - rockhopper - 15.05.2014

Ok wait
Код:
#define DIALOG_SKILL
    #define DIALOG_COMMANDS
    #define DIALOG_RAPISTINFO
    #define DIALOG_PICKPOCKETINFO
    #define DIALOG_MECHANICINFO
    #define DIALOG_HITMANINFO
    #define DIALOG_WEAPONDEALERINFO
    #define DIALOG_DRUGDEALERINFO
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
		case DIALOG_SKILL:// Our dialog!
    	    {
           	switch(listitem)// Checking which listitem was selected
        	{
        	    case 0:// The first item listed
        	    {
                    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Rapist Skill!",name);
                    SendClientMessageToAll( -1,string);
					SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
        	        SendClientMessage(playerid, COLOR_RED,"You have become a Rapist");
        	        SetPlayerTeam(playerid, TEAM_RAPIST);
        	        SetPlayerColor(playerid, COLOR_GHOSTWHITE);
        	        GivePlayerWeapon(playerid,5,1,17,3,22,100,41,200);
        	    }
        	    case 1: // The second item listed
        	    {
                    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen PickPocket Skill!",name);
                    SendClientMessageToAll( -1,string);
					SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
        	        SendClientMessage(playerid, COLOR_RED,"You have become a PickPocket");
        	        SetPlayerTeam(playerid, TEAM_PICKPOCKET);
        	        SetPlayerColor(playerid, COLOR_GHOSTWHITE);
        	        GivePlayerWeapon(playerid,15,1,22,200,29,200);
        	    }
        	    case 2: // The second item listed
        	    {
                    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Mechanic Skill!",name);
                    SendClientMessageToAll( -1,string);
					SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
        	        SendClientMessage(playerid, COLOR_RED,"You have become a Mechanic");
        	        SetPlayerTeam(playerid, TEAM_MECHANIC);
        	        SetPlayerColor(playerid, COLOR_GHOSTWHITE);
        	        GivePlayerWeapon(playerid,10,1,11,1,12,1,13,1);
        	    }
        	    case 3: // The second item listed
        	    {
                    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Hitman Skill!",name);
                    SendClientMessageToAll( -1,string);
					SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
        	        SendClientMessage(playerid, COLOR_RED,"You have become a Hitman");
        	        SetPlayerTeam(playerid, TEAM_HITMAN);
        	        SetPlayerColor(playerid, COLOR_GHOSTWHITE);
        	        GivePlayerWeapon(playerid,4,1,23,200,25,75,34,50);
        	    }
        	    case 4: // The second item listed
        	    {
                     new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Weapon Dealer Skill",name);
                    SendClientMessageToAll( -1,string);
					SendClientMessage(playerid, COLOR_RED,"You have become a Weapon Dealer");
					SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
					SetPlayerTeam(playerid, TEAM_WEAPONDEALER);
        	        SetPlayerColor(playerid, COLOR_GHOSTWHITE);
        	        GivePlayerWeapon(playerid,24,50,26,20,32,100,30,200);

        	    }
        	    
        	    case 5: // The second item listed
        	    {
        	    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Drug Dealer Skill",name);
                    SendClientMessageToAll( -1,string);
					SendClientMessage(playerid, COLOR_RED,"You have become a Drug Dealer");
					SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
					SetPlayerTeam(playerid, TEAM_DRUGDEALER);
        	        SetPlayerColor(playerid, COLOR_GHOSTWHITE);
        	        GivePlayerWeapon(playerid,24,50,32,100,30,200);
					
        	    }
    	    }
		 }
			case DIALOG_COMMANDS:// Our dialog!
    	    {
           	switch(listitem)
        	{
        	    case 0:// The first item listed
        	    {
        	        SendClientMessage(playerid, COLOR_RED,"Commands Coming Soon");
        	    }
        	    case 1: // The second item listed
        	    {
        	        SendClientMessage(playerid, COLOR_RED,"Commands Coming Soon");
        	    }
        	    case 2: // The second item listed
        	    {
        	        SendClientMessage(playerid, COLOR_RED,"Commands Coming Soon");
        	    }
        	    case 3: // The second item listed
        	    {
        	        SendClientMessage(playerid, COLOR_RED,"Commands Coming Soon");
        	    }
	}}
	         case DIALOG_RAPISTINFO:// Our dialog!
    	    {
           	SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /rape");
	}
	case DIALOG_PICKPOCKETINFO:// Our dialog!
    	    {
           	SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /rob , /robshop , /fool");
	}
	case DIALOG_MECHANICINFO:// Our dialog!
    	    {
           	SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /mechanicmenu");
	}
	case DIALOG_HITMANINFO:// Our dialog!
    	    {
           	SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /contracts");
	}
	case DIALOG_WEAPONDEALERINFO:// Our dialog!
    	    {
           	SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /sellweaps");
	}
	case DIALOG_DRUGDEALERINFO:// Our dialog!
    	    {
           	SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /selldrugs");
	}
    }}
    return 0;
}



Re: Errors please help! - AroseKhanNiazi - 15.05.2014

pawn Код:
#define DIALOG_SKILL 13254
    #define DIALOG_COMMANDS 16584
    #define DIALOG_RAPISTINFO 56487
    #define DIALOG_PICKPOCKETINFO 56484
    #define DIALOG_MECHANICINFO 36469
    #define DIALOG_HITMANINFO 15146
    #define DIALOG_WEAPONDEALERINFO 13548
    #define DIALOG_DRUGDEALERINFO 32648
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
        case DIALOG_SKILL:// Our dialog!
            {
            switch(listitem)// Checking which listitem was selected
            {
                case 0:// The first item listed
                {
                    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Rapist Skill!",name);
                    SendClientMessageToAll( -1,string);
                    SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
                    SendClientMessage(playerid, COLOR_RED,"You have become a Rapist");
                    SetPlayerTeam(playerid, TEAM_RAPIST);
                    SetPlayerColor(playerid, COLOR_GHOSTWHITE);
                    GivePlayerWeapon(playerid,5,1,17,3,22,100,41,200);
                }
                case 1: // The second item listed
                {
                    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen PickPocket Skill!",name);
                    SendClientMessageToAll( -1,string);
                    SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
                    SendClientMessage(playerid, COLOR_RED,"You have become a PickPocket");
                    SetPlayerTeam(playerid, TEAM_PICKPOCKET);
                    SetPlayerColor(playerid, COLOR_GHOSTWHITE);
                    GivePlayerWeapon(playerid,15,1,22,200,29,200);
                }
                case 2: // The second item listed
                {
                    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Mechanic Skill!",name);
                    SendClientMessageToAll( -1,string);
                    SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
                    SendClientMessage(playerid, COLOR_RED,"You have become a Mechanic");
                    SetPlayerTeam(playerid, TEAM_MECHANIC);
                    SetPlayerColor(playerid, COLOR_GHOSTWHITE);
                    GivePlayerWeapon(playerid,10,1,11,1,12,1,13,1);
                }
                case 3: // The second item listed
                {
                    new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Hitman Skill!",name);
                    SendClientMessageToAll( -1,string);
                    SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
                    SendClientMessage(playerid, COLOR_RED,"You have become a Hitman");
                    SetPlayerTeam(playerid, TEAM_HITMAN);
                    SetPlayerColor(playerid, COLOR_GHOSTWHITE);
                    GivePlayerWeapon(playerid,4,1,23,200,25,75,34,50);
                }
                case 4: // The second item listed
                {
                     new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Weapon Dealer Skill",name);
                    SendClientMessageToAll( -1,string);
                    SendClientMessage(playerid, COLOR_RED,"You have become a Weapon Dealer");
                    SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
                    SetPlayerTeam(playerid, TEAM_WEAPONDEALER);
                    SetPlayerColor(playerid, COLOR_GHOSTWHITE);
                    GivePlayerWeapon(playerid,24,50,26,20,32,100,30,200);

                }
               
                case 5: // The second item listed
                {
                new string [128];
                    ResetPlayerWeapons(playerid);
                    new name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string,sizeof(string),"%s has chosen Drug Dealer Skill",name);
                    SendClientMessageToAll( -1,string);
                    SendClientMessage(playerid, COLOR_RED,"You have become a Drug Dealer");
                    SendClientMessage(playerid, COLOR_RED,"Please type /skillinfo for more information!");
                    SetPlayerTeam(playerid, TEAM_DRUGDEALER);
                    SetPlayerColor(playerid, COLOR_GHOSTWHITE);
                    GivePlayerWeapon(playerid,24,50,32,100,30,200);
                   
                }
            }
         }
            case DIALOG_COMMANDS:// Our dialog!
            {
            switch(listitem)
            {
                case 0:// The first item listed
                {
                    SendClientMessage(playerid, COLOR_RED,"Commands Coming Soon");
                }
                case 1: // The second item listed
                {
                    SendClientMessage(playerid, COLOR_RED,"Commands Coming Soon");
                }
                case 2: // The second item listed
                {
                    SendClientMessage(playerid, COLOR_RED,"Commands Coming Soon");
                }
                case 3: // The second item listed
                {
                    SendClientMessage(playerid, COLOR_RED,"Commands Coming Soon");
                }
    }}
             case DIALOG_RAPISTINFO:// Our dialog!
            {
            SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /rape");
    }
    case DIALOG_PICKPOCKETINFO:// Our dialog!
            {
            SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /rob , /robshop , /fool");
    }
    case DIALOG_MECHANICINFO:// Our dialog!
            {
            SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /mechanicmenu");
    }
    case DIALOG_HITMANINFO:// Our dialog!
            {
            SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /contracts");
    }
    case DIALOG_WEAPONDEALERINFO:// Our dialog!
            {
            SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /sellweaps");
    }
    case DIALOG_DRUGDEALERINFO:// Our dialog!
            {
            SendClientMessage(playerid, COLOR_PINK,"[Skill INFO]Your commands are:- /selldrugs");
    }
    }}
    return 0;
}
try this if doesn't work tell me