27.04.2012, 00:24
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:
Code for replacing the dealership's owner:
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.
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;
}
pawn Код:
strmid(Dealership[i][dOwner], GetName(playerid), 0, strlen(GetName(playerid)), 24);
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.