Need help with RemoveUnderScore(playerid);(playerid);
#1

So as you see in I have a problem with RemoveUnderScore(playerid);

here is the error:

Quote:

error 017: undefined symbol "RemoveUnderScore"

Here is the code:

pawn Код:
YCMD:buybiz(playerid, params[],help)
{

    new id = IsPlayerNearBizEnt(playerid);

    if(id == -1 || id == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not near a biz");

    if(BusinessInfo[id][bOwned] != 0 || BusinessInfo[id][bPrice] == 0) return SendClientMessage(playerid, COLOR_GREY, "This biz is not for sale.");

    if(pInfo[playerid][BizID] != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You already own a biz.");

    if(pInfo[playerid][Money] < BusinessInfo[id][bPrice]) return SendClientMessage(playerid, COLOR_LIGHTRED, "Sorry, you can not afford this biz.");

    pInfo[playerid][BizID] = id;
    pInfo[playerid][Money] -= BusinessInfo[id][bPrice];
    GivePlayerMoney(playerid, -BusinessInfo[id][bPrice]);
    BusinessInfo[id][bLocked] = 0;
    BusinessInfo[id][bOwned] = 1;
    BusinessInfo[id][bOwner] = RemoveUnderScore(playerid);[B]//This line[/B]
    SendClientMessage(playerid, COLOR_YELLOW, "Congratulations on your new biz! Use /bizhelp to get help, or /ask!");
    return 1;
}
Reply
#2

That isn't a native SA:MP function.

So to actually use that function, I would create a stock for it, as the script is telling you that there is no defined symbol for "RemoveUnderScore"
Reply
#3

Yeah when I it worked thanks mate

For some one who needs the same.. I used:

pawn Код:
stock RemoveUnderScore(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)