29.09.2010, 19:55
Anyhow, I built a script that allows a player to advertise everything that he wants, seems like everything works, besides the advertise it's self, when I get to the place It shots "Unknown command " and You are not near the Advertisement building ! can any one take a look ? It should be ad that everyone can see.
PHP код:
if(strcmp("/ad", cmdtext, true, 6) == 0)
{
static ad;
new iName[MAX_PLAYER_NAME+1];
new cmd[256];
new tmp[256];
new idx;
cmd = strtok(cmdtext, idx);
if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,0xAFAFAFAA,"Usage: /ad (message)");
return 1;
}
GetPlayerName(playerid,iName,sizeof(iName));
if(IsPlayerConnected(playerid))
if(IsPlayerInRangeOfPoint(playerid, 50, 1729.6362,-1277.4733,13.5468))
if(!ad)
GivePlayerMoney(playerid, -1000);
SendClientMessageToAll(0x52ED07FF, "[Advertisement] %s %s");
return 1;
}
else { SendClientMessage(playerid, 0xFF4646FF,"You are not near the Advertisement building !"); }
return 0;
}