Adding player name to .ini file
#1

Hey guys, I haven't been scripting for a LONG LONG time and I'm really confused at the moment, I ran into some errors.

Basically I'm editing a script and I'd like to add the player's name to an .ini file.

Players can put down objects and I'd like to know who put them down by displaying it in the object's .ini file

The Code I use(everything else is written in the ini file, I'm trying to add this):

pawn Код:
BaseInfo[NewID][bOwner] = GetName(playerid);
The GetName(playerid) wasn't created by me but it works with other commands.:

pawn Код:
stock GetName(playerid)
{
    new string[128];
    GetPlayerName(playerid,string,24);
    new str[24];
    strmid(str,string,0,strlen(string),24);
    return str;
}
The error code I get when trying to compile:

Код:
error 006: must be assigned to an array
Any help is appreciated, thank you very much in advance!
Reply
#2

In your BaseInfo array, you have defined bOwner as a variable. Define it as:

bOwner[MAX_PLAYER_NAME]

If you haven't, please post the enum here.

Also alter the size of string in your GetName Stock, it's a waste of useable memory, and servers today are very strict about memory usage per player.
Reply
#3

WOrked. Thnaks
Reply
#4

Yeah it worked for me too, thank you very much! Can I contact you on Skype if I have a few minor questions? I'm not making a server or anything I'm just scripting for fun.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)