New command, needs a fix - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: New command, needs a fix (
/showthread.php?tid=180050)
New command, needs a fix -
Scriptissue - 29.09.2010
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;
}
Re: New command, needs a fix -
Scenario - 29.09.2010
You know what? I'm sick of you coming here every 10 seconds with a new problem. Look into things yourself! It helps by comparing your code to a code in a working GM -
not stealing the code. If that doesn't help, you need to take a look at the
SA-MP Wiki. I understand this is the "scripting discussion" board, but please at least attempt to solve issues on your own. I have seen your code and a lot of it (maybe not this) looks like it's missing large pieces.
Re: New command, needs a fix -
The_Moddler - 29.09.2010
Use SSCANF
Re: New command, needs a fix -
Scriptissue - 29.09.2010
Realcop, I looked into it, I'm not stealing codes, I'm trying to learn by asking you, I just started this week.
Can you help me ?
Re: New command, needs a fix -
Scenario - 29.09.2010
I didn't say you were stealing code. "It helps by comparing your code to a code in a working GM - not stealing the code." - meaning you should look at another GM's command or whatever and compare it to yours. Just do not steal the code instead of fixing your own.
Like "The_Moddler" said, use SSCANF(2).
Re: New command, needs a fix -
Scriptissue - 29.09.2010
........