SA-MP Forums Archive
Accent System. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Accent System. (/showthread.php?tid=256899)



Accent System. - Luis- - 22.05.2011

Well, I have my account system working but for some reason my accent is being a pain in the ass.

pawn Код:
enum pInfo
{
    pName[20],
    pPass[16],
    pLevel,
    pCash,
    pAdmin,
    Float:pHealth,
    Float:pArmour,
    Float:pPosX,
    Float:pPosY,
    Float:pPosZ,
    pAccent, // Accent.
    pTut,
    pSkin,
    bool:pLogged
};
new PlayerInfo[MAX_PLAYERS][pInfo];
OnPlayerText:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new str[128];
    format(str, sizeof(str), "%s says [%s accent]: %s", PlayerName(playerid), PlayerInfo[playerid][pAccent], text);
    ProxDetector(10.0, playerid, str, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
    print(str);
    return 0;
}
I have no idea what could be causing it, it is loading fine from the mysql database.


Re: Accent System. - BizzyD - 22.05.2011

pawn Код:
public OnPlayerText(playerid, text[])
{
    new str[128];
    new accent = PlayerInfo[playerid][pAccent];
    format(str, sizeof(str), "%s says [%s accent]: %s", PlayerName(playerid), accent, text);
    ProxDetector(10.0, playerid, str, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
    print(str);
    return 0;
}
I had some troubles with that on my GM when i had /stats. So i had to make it like that, try that instead


Re: Accent System. - Luis- - 22.05.2011

Still nothing. Here's a picture of what happens:



Re: Accent System. - [L3th4l] - 22.05.2011

pawn Код:
PlayerInfo[playerid][pAccent]
Is an integer, you are formatting it as a string.


Re: Accent System. - Luis- - 22.05.2011

So I would change "%s" for "%i", even though I did that and it made it now say "0 accent".


Re: Accent System. - ddnbb - 22.05.2011

Quote:
Originally Posted by -Luis
Посмотреть сообщение
So I would change "%s" for "%i", even though I did that and it made it now say "0 accent".
Try this:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new str[128];
    format(str, sizeof(str), "%s says [%s accent]: %s", PlayerName(playerid), PlayerInfo[playerid][pAccent],text[1]);
    ProxDetector(10.0, playerid, str, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
    print(str);
    return 0;
}



Re: Accent System. - Luis- - 22.05.2011

Quote:
Originally Posted by ddnbb
Посмотреть сообщение
Try this:
pawn Код:
public OnPlayerText(playerid, text[])
{
    new str[128];
    format(str, sizeof(str), "%s says [%s accent]: %s", PlayerName(playerid), PlayerInfo[playerid][pAccent],text[1]);
    ProxDetector(10.0, playerid, str, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
    print(str);
    return 0;
}
You must be attempting to get your post count up as this does nothing to my Accent problem, it actually removes the first letter I use, Example: "Luis [American accent]: kk." it removes the red "k".


Re: Accent System. - Steven82 - 22.05.2011

Just create a custom function that detects the accent integer and in the function say

1 = American
2 = Mexican

etc. Not hard to do..


Re: Accent System. - Luis- - 22.05.2011

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Just create a custom function that detects the accent integer and in the function say

1 = American
2 = Mexican

etc. Not hard to do..
I would prefer to use the thing I am using now, it must be an easy fix.


Re: Accent System. - Steven82 - 22.05.2011

Obviously your not paying attention.

pawn Код:
stock GetPlayerAccent(playerid)
{
new atext[128];
switch(PlayerInfo[playerid][pAccent])
{
case 1: atext = "American";
}
return atext;
}
Thats a rough code, if it doesn't work should be simple bug fixes