Custom Rank Name
#1

I'd like some help with this. When you type /makeleader in my command I need a way of setting the rank to a string.

So for example, I wont show you the faction command, just a few variables and you can help me if you want.

pawn Код:
CMD:makeleader(playerid, params[])
{
       PlayerInfo[targetid][pRank] = { "Default" }
}
Reply
#2

You can't assign a string like that. Use strcat. Strcat APPENDS (adds to the end of - cat = concatenate) one string to another. You'll have to empty the string first to make it over-write all of it.

pawn Код:
destinationString[0] = 0; // Clear destination string
strcat(destinationString, "Source");
This can be defined as a macro to make it easier. ****** 'strcpy' or 'memcpy'.
Reply
#3

I've done it like this.

pawn Код:
CMD:makeleader(playerid, params[])
{
      new rank[36];
      PlayerInfo[targetid][pRank] = "Default";
}
Or would I need to do it like:

pawn Код:
CMD:makeleader(playerid, params[])
{
       new rank[36];
       format(rank, sizeof(rank), "Default");
       PlayerInfo[targetid][pRank] = rank;
}
Reply
#4

why dont u try both but 2nd one looks ok
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)