SA-MP Forums Archive
need help - im confused - 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: need help - im confused (/showthread.php?tid=522419)



need help - im confused - ILoveBacon - 27.06.2014

hello, i really need help

First i have this on my script
Код:
CMD:accent(playerid, params[])
{
	SendClientMessage(playerid, COLOR_GRAD1, "USAGE: {FFFFFF}/accent [name]");
	SendClientMessage(playerid, COLOR_GRAD1, "Available Accents:None, British, Japanese, Chinese, Korean, Scottish, Irish\nAvailable Accents:Mexican, Hick, Cuban, Italian, Gangsta, Australian, Arab\nAvailable Accents:Canadian, Gay, Pikey, Russian, Dutch");

	if(!strcmp(params,"None",true))
	{
		PlayerInfo[playerid][pAccent] = 0;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be None!");
	}
	else if(!strcmp(params,"British",true))
	{
		PlayerInfo[playerid][pAccent] = 1;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be British!");
	}
	else if(!strcmp(params,"Japanese",true))
	{
		PlayerInfo[playerid][pAccent] = 2;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Japanese!");
	}
	else if(!strcmp(params,"Chinese",true))
	{
		PlayerInfo[playerid][pAccent] = 3;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Chinese!");
	}
	else if(!strcmp(params,"Korean",true))
	{
		PlayerInfo[playerid][pAccent] = 4;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Korean!");
	}
	else if(!strcmp(params,"Scottish",true))
	{
		PlayerInfo[playerid][pAccent] = 5;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Scottish!");
	}
	else if(!strcmp(params,"Irish",true))
	{
		PlayerInfo[playerid][pAccent] = 6;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Irish!");
	}
	else if(!strcmp(params,"Mexican", true))
	{
		PlayerInfo[playerid][pAccent] = 7;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Mexican!");
	}
	else if(!strcmp(params,"Hick",true))
	{
		PlayerInfo[playerid][pAccent] = 8;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Hick!");
	}
	else if(!strcmp(params,"Cuban",true))
	{
		PlayerInfo[playerid][pAccent] = 9;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Cuban!");
	}
	else if(!strcmp(params,"Italian",true))
	{
		PlayerInfo[playerid][pAccent] = 10;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Italian!");
	}
	else if(!strcmp(params,"Gangsta",true))
	{
		PlayerInfo[playerid][pAccent] = 11;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Gangsta!");
	}
	else if(!strcmp(params,"Australian",true))
	{
		PlayerInfo[playerid][pAccent] = 12;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Australian!");
	}
	else if(!strcmp(params,"Arab",true))
	{
		PlayerInfo[playerid][pAccent] = 13;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Arab!");
	}
	else if(!strcmp(params,"Canadian",true))
	{
		PlayerInfo[playerid][pAccent] = 14;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Canadian!");
	}
	else if(!strcmp(params,"Gay",true))
	{
		PlayerInfo[playerid][pAccent] = 15;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Gay!");
	}
	else if(!strcmp(params,"Pikey",true))
	{
		PlayerInfo[playerid][pAccent] = 16;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Pikey!");
	}
	else if(!strcmp(params,"Russian",true))
	{
		PlayerInfo[playerid][pAccent] = 17;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Russian!");
	}
	else if(!strcmp(params,"Dutch",true))
	{
		PlayerInfo[playerid][pAccent] = 18;
		SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Dutch!");
	}
	else return SendClientMessage(playerid, COLOR_GREY, "Invalid accent!");
	return 1;
}
But when in game, i do /accent.
And how to remove the "Invalid accent!" ?

Image :



Re: need help - im confused - Noliax8 - 27.06.2014

PHP код:
if(!strcmp(params"None"true /* HERE */)) 
Quote:

ignorecase (optional)
When set to true, the case doesn't matter - HeLLo is the same as Hello. When false, they're not the same.

https://sampwiki.blast.hk/wiki/Strcmp

Fuck, it's not that. I see again, wait

This:
PHP код:

CMD
:accent(playeridparams[])
{
    if(
isnull(params))
    {
        
SendClientMessage(playeridCOLOR_GRAD1"USAGE: {FFFFFF}/accent [name]");
        
SendClientMessage(playeridCOLOR_GRAD1"Available Accents:None, British, Japanese, Chinese, Korean, Scottish, Irish\nAvailable Accents:Mexican, Hick, Cuban, Italian, Gangsta, Australian, Arab\nAvailable Accents:Canadian, Gay, Pikey, Russian, Dutch");
        return 
1;
    }
// .... 
Nlx.


Re: need help - im confused - Konstantinos - 27.06.2014

pawn Код:
CMD:accent(playerid, params[])
{
    if (isnull(params))
    {
        SendClientMessage(playerid, COLOR_GRAD1, "USAGE: {FFFFFF}/accent [name]");
        SendClientMessage(playerid, COLOR_GRAD1, "Available Accents:None, British, Japanese, Chinese, Korean, Scottish, Irish\nAvailable Accents:Mexican, Hick, Cuban, Italian, Gangsta, Australian, Arab\nAvailable Accents:Canadian, Gay, Pikey, Russian, Dutch");
    }
    else
    {
        if(!strcmp(params,"None",true))
        {
            PlayerInfo[playerid][pAccent] = 0;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be None!");
        }
        else if(!strcmp(params,"British",true))
        {
            PlayerInfo[playerid][pAccent] = 1;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be British!");
        }
        else if(!strcmp(params,"Japanese",true))
        {
            PlayerInfo[playerid][pAccent] = 2;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Japanese!");
        }
        else if(!strcmp(params,"Chinese",true))
        {
            PlayerInfo[playerid][pAccent] = 3;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Chinese!");
        }
        else if(!strcmp(params,"Korean",true))
        {
            PlayerInfo[playerid][pAccent] = 4;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Korean!");
        }
        else if(!strcmp(params,"Scottish",true))
        {
            PlayerInfo[playerid][pAccent] = 5;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Scottish!");
        }
        else if(!strcmp(params,"Irish",true))
        {
            PlayerInfo[playerid][pAccent] = 6;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Irish!");
        }
        else if(!strcmp(params,"Mexican", true))
        {
            PlayerInfo[playerid][pAccent] = 7;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Mexican!");
        }
        else if(!strcmp(params,"Hick",true))
        {
            PlayerInfo[playerid][pAccent] = 8;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Hick!");
        }
        else if(!strcmp(params,"Cuban",true))
        {
            PlayerInfo[playerid][pAccent] = 9;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Cuban!");
        }
        else if(!strcmp(params,"Italian",true))
        {
            PlayerInfo[playerid][pAccent] = 10;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Italian!");
        }
        else if(!strcmp(params,"Gangsta",true))
        {
            PlayerInfo[playerid][pAccent] = 11;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Gangsta!");
        }
        else if(!strcmp(params,"Australian",true))
        {
            PlayerInfo[playerid][pAccent] = 12;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Australian!");
        }
        else if(!strcmp(params,"Arab",true))
        {
            PlayerInfo[playerid][pAccent] = 13;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Arab!");
        }
        else if(!strcmp(params,"Canadian",true))
        {
            PlayerInfo[playerid][pAccent] = 14;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Canadian!");
        }
        else if(!strcmp(params,"Gay",true))
        {
            PlayerInfo[playerid][pAccent] = 15;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Gay!");
        }
        else if(!strcmp(params,"Pikey",true))
        {
            PlayerInfo[playerid][pAccent] = 16;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Pikey!");
        }
        else if(!strcmp(params,"Russian",true))
        {
            PlayerInfo[playerid][pAccent] = 17;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Russian!");
        }
        else if(!strcmp(params,"Dutch",true))
        {
            PlayerInfo[playerid][pAccent] = 18;
            SendClientMessage(playerid, COLOR_GRAD1, "You've changed your accent to be Dutch!");
        }
        else SendClientMessage(playerid, COLOR_GREY, "Invalid accent!");
    }
    return 1;
}



Re: need help - im confused - ILoveBacon - 27.06.2014

Thanks for help, but i mean i want to make it show the "Accent List" Like

When player do command /accent, It show this. Below

USAGE: /accent [name]
Available Accents:None, British, Japanese, Chinese, Korean, Scottish, Irish
Available Accents:Mexican, Hick, Cuban, Italian, Gangsta, Australian, Arab
Available Accents:Canadian, Gay, Pikey, Russian, Dutch


Re: need help - im confused - Konstantinos - 27.06.2014

You want to show the accent list instead of the "Invalid accent!" message? If so replace:
pawn Код:
else SendClientMessage(playerid, COLOR_GREY, "Invalid accent!");
with:
pawn Код:
else
{
    SendClientMessage(playerid, COLOR_GREY, "USAGE: /accent [name]");
    SendClientMessage(playerid, COLOR_GREY, "Available Accents:None, British, Japanese, Chinese, Korean, Scottish, Irish");
    SendClientMessage(playerid, COLOR_GREY, "Available Accents:Mexican, Hick, Cuban, Italian, Gangsta, Australian, Arab");
    SendClientMessage(playerid, COLOR_GREY, "Available Accents:Canadian, Gay, Pikey, Russian, Dutch");
}
@Noliax8: Editing your post and adding the "isnull" after seeing my post is a bit..


Re: need help - im confused - ILoveBacon - 27.06.2014

Sorry, forget about the "Invalid accent!".

i want to show the accent list when player perform the command /accent.
And when player did /accent command it will show all the accent list.


Re: need help - im confused - Noliax8 - 27.06.2014

I changed too late, sorry Konstantinos, else delete if(isnull()) and sendClientMessage "USAGE" in the bottom (else).

I stop my help, you must to use your HEAD!