What's wrong?
#1

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;
}
Reply
#2

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

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

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

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

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.
Reply
#7

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

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.
Reply
#9

Nvm, I did it simple and easier without %s

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

Reply
#10

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...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)