Accent System.
#1

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.
Reply
#2

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
Reply
#3

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

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

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

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;
}
Reply
#7

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".
Reply
#8

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

1 = American
2 = Mexican

etc. Not hard to do..
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)