/factionadvertise Command
#1

Hello. I've made a /factionad command, everything works except the string. I got a function, "GetPlayerFactionName", and i'm sure it's working.

pawn Код:
format(string, sizeof(string), "Advertisement: %s [%s]",  result, GetPlayerFactionName);
I get a error, it says error 076: syntax error in the expression, or invalid function call. I know it probably shouldn't say GetPlayerFactionName, but what shall i write instead?

Thanks in advance.

Bates
Reply
#2

GetPlayerFactionName is not a standard SA:MP function.
Have you created a function for it?

If not, add something like

pawn Код:
forward GetPlayerFactionName(playerid);


GetPlayerFactionName(playerid);
{
    Add shit
    return 1;
}
If you did add it, check if you added "new string[number_here];" and shit

Also, can you show the whole command please?

Edit: I've had this error to, but I dont know how I fixed it...lol
Reply
#3

If there is a parameter in GetPlayerFactionName, like playerid, you need to do:

pawn Код:
format(string, sizeof(string), "Advertisement: %s [%s]",  result, GetPlayerFactionName(playerid));
instead of what you did before. I'm not sure if this will work, but good luck.
Reply
#4

Quote:
Originally Posted by Hiitch
Посмотреть сообщение
If there is a parameter in GetPlayerFactionName, like playerid, you need to do:

pawn Код:
format(string, sizeof(string), "Advertisement: %s [%s]",  result, GetPlayerFactionName(playerid));
instead of what you did before. I'm not sure if this will work, but good luck.
Thanks! It worked.

Thanks again!
Reply
#5

Quote:
Originally Posted by Bates
Посмотреть сообщение
Thanks! It worked.

Thanks again!
No problem sir. Glad I could help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)