SA-MP Forums Archive
What's wrong? - 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)
+--- Thread: What's wrong? (/showthread.php?tid=543447)



What's wrong? - Glossy42O - 26.10.2014

Hello i have created a /site command.

No errors no warnings, but when i am in game and i am typing /site it does nothing not even "Unknown command"

Here is my code.
Код:
CMD:site(playerid, params[])
{
  new name[MAX_PLAYER_NAME], string[589+MAX_PLAYER_NAME];
  GetPlayerName(playerid, name,sizeof(name));
  format(string, sizeof(string), "{FF9966}[BOT]{FFFFFF}: Hello {FFFF33}%s{FFFFFF}, Our website is {FF0000}www.lscnr-samp.url.ph",name);
  SendClientMessage(0xFFFFFFF, -1, playerid);
  return 1;
}



Re: What's wrong? - Abagail - 26.10.2014

Do you have ZCMD included? Are you using any OnPlayerCommandText codes/scripts that may be preventing ZCMD from operating properly?


Re: What's wrong? - Glossy42O - 26.10.2014

It's in the right place everything is o k and yes it is included


Re: What's wrong? - Abagail - 26.10.2014

What other scripts do you have loaded? Does your gamemode use OnPlayerCommandText?


Re: What's wrong? - Glossy42O - 26.10.2014

Na listen everything is ok just the command ain't working maybe i should put it under another command ?


Re: What's wrong? - mkmk - 26.10.2014

Quote:
Originally Posted by Stuun
Посмотреть сообщение
Na listen everything is ok just the command ain't working maybe i should put it under another command ?
This happened once to me, it was because I had an outdated pawno version even though I had no idea I did (other scripts were working that same day).

I just had someone send me their version of it (in your case, just reinstall).
Best advice I can give you as the script is perfectly right.


Re: What's wrong? - Glossy42O - 27.10.2014

How to reinstall ? delete and ? where can i download pawn lol


Re: What's wrong? - Threshold - 27.10.2014

Update pawno if you wish, but I highly doubt it's necessary, nor is it the source of the problem. (http://files.sa-mp.com/samp03z_svr_R1_win32.zip)

Also make sure you have the correct version of the zcmd include. (https://sampforum.blast.hk/showthread.php?tid=91354)

Not to mention, there is no WAY that you will need a string that size. That is a ridiculous amount of useless waste.
pawn Код:
CMD:site(playerid, params[])
{
    new name[MAX_PLAYER_NAME], string[120];
    GetPlayerName(playerid, name,sizeof(name));
    format(string, sizeof(string), "{FF9966}[BOT]{FFFFFF}: Hello {FFFF33}%s{FFFFFF}, Our website is {FF0000}www.lscnr-samp.url.ph",name);
    SendClientMessage(playerid, -1, string);
    return 1;
}
EDIT: Or maybe it's because you used 'playerid' instead of 'string' and '0xFFFFFFFF' instead of 'playerid'... lol.


Re: What's wrong? - Glossy42O - 27.10.2014

Nvm, I did it simple and easier without %s

Like that
PHP код:
CMD:site(playeridparams[])
{
  
SendClientMessage(playerid, -1"Bla bla bla");
  return 
1;




Re: What's wrong? - Threshold - 27.10.2014

If you want it to say the player's name, then you need to use format. Instead of the typical "Nevermind I fixed it myself" answer, you're welcome...