Help me I can't make it work. -
It's an old command, I did using the old fashion but still....
When the player uses the command it posts an Advertisement but in my case It only posts [Advertisement] and then the name, nothing more, my main aim is to allow text to appear in the advertisement but It doesn't work.
PHP код:
new cmd[256];
new tmp[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,0xAFAFAFAA,"Usage: /ad [advertisement] ");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 50, 1729.6362,-1277.4733,13.5468))
{
new Message[128];
GivePlayerMoney(playerid, -1000);
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername)); // This is for admin name
format( Message, sizeof( Message ), "[Advertisement] %s %s", Message, GetPlayerNameEx( playerid )); //No point having two strings vars, as
SendClientMessageToAll(0x52ED07FF, Message);
return 1;
}
else { SendClientMessage(playerid, 0xFF4646FF,"You are not at the advertisement building !"); }
}
return 1;
}
return 0;
}