Underscores
#1

I'm trying to save data, specifically a player's name as the owner of a vehicle dealership. I've got functions that gets a player's name(with underscores) and another one that removes the underscores. Now when I update the table for the dealerships to the player's name(with an underscore) it still removes it.

To make it simpler:
1. Player_Name connects, logs in, etc.
2. Buys a dealership, so it would be saved as "Player_Name" for the owner.
3. After buying, it saves as "Player Name" - obviously without the underscore.

Code for getting the name with an underscore:
pawn Код:
stock GetName(playerid) // Player name with underscore
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
Code for replacing the dealership's owner:
pawn Код:
strmid(Dealership[i][dOwner], GetName(playerid), 0, strlen(GetName(playerid)), 24);
I don't see anything wrong at all, could anyone suggest a solution for this? Thanks!
Edit: It's weird, since I use the same method when a player registers for an account and it saves the name with an underscore.
Reply


Messages In This Thread
Underscores - by Skribblez - 27.04.2012, 00:24
Respuesta: Underscores - by admantis - 27.04.2012, 00:36
Re: Underscores - by Skribblez - 27.04.2012, 00:41

Forum Jump:


Users browsing this thread: 1 Guest(s)