How to make a command
#1

Hey guys,I want to make a command which can set the player's skin (by the whole player ,no admin staff)
How to make that using ZCMD? and where can i get it's last update?(the zcmd)
Reply
#2

I would recommend Y_CMD over zcmd. It has very similar syntax. If you can migrate to this system I have tutorials on it (see signature). https://sampforum.blast.hk/showthread.php?tid=571047
Reply
#3

He isn't asking for anything else, he is asking for Z-CMD. You shouldn't be advertising includes when he is asking for something he wants, not asking for something else.

You can find Z-CMD here:
http://pastebin.com/2qdq8MTN

And as for the command:

pawn Код:
CMD:setmyskin(playerid, params[])
{
      new skin = strval(params);
      if(skin < 0 || skin > 311) return SendClientMessage(playerid, -1, "Invalid skin!");

      SetPlayerSkin(playerid, skin);
      return 1;
}
Reply
#4

Another small question:

I made a PlayerPlaySound when a player joins the server,how to stop it after the player spawn?
Reply
#5

Quote:
Originally Posted by 7Ahmad7
Посмотреть сообщение
Another small question:

I made a PlayerPlaySound when a player joins the server,how to stop it after the player spawn?
Play the sound that stops it if the should being played is a song-type sound.

BEE_TRACK_SOUND:

Play:
pawn Код:
PlayerPlaySound(playerid,1076,0.0,0.0,0.0);
Stop:
pawn Код:
PlayerPlaySound(playerid,1077,0.0,0.0,0.0);
Reply
#6

I have an updated version of ZCMD here
https://sampforum.blast.hk/showthread.php?pid=3468241#pid3468241

I-ZCMD works like ZCMD.The only change is in performance.I-ZCMD is twice as fast as ZCMD and thrice as fast as y_commands.

EDIT:Fixed the code.Thanks Abagail
Код:
COMMAND:setskin(playerid,params[])
{
      new skinid;
      if(sscanf(params,"i",skinid)) SendClientMessage(playerid,"Usage:/setskin [skinid]");
      else ifif(skin < 0 || skin > 311) return SendClientMessage(playerid, -1, "Invalid skin!");
      else SetPlayerSkin(playerid, skin);
      return 1;
}
Reply
#7

You need to check if the skin is valid(0-311) or not or else it will set to CJ skin and or crash(it seems it sets to CJ instead of crashing in the RC versions -> haven't tested on the final release)
Reply
#8

Guys,ther eis some errors on that code,My fixed code :
pawn Код:
CMD:skin(playerid,params[])
{
      new skinid;
      if(sscanf(params,"i",skinid)) SendClientMessage(playerid,"Usage:/setskin [skinid]");
      else if(skinid < 0 || skinid > 311) return SendClientMessage(playerid, -1, "Invalid skin!");
      else SetPlayerSkin(playerid, skinid);
      return 1;
}
And i fixed 4 errors,still got 2:
D:\Programmes\Engabic Blood Server\gamemodes\EABS.pwn(393) : error 017: undefined symbol "sscanf"
D:\Programmes\Engabic Blood Server\gamemodes\EABS.pwn(393) : error 035: argument type mismatch (argument 2)
Reply
#9

Quote:
Originally Posted by 7Ahmad7
Посмотреть сообщение
Guys,ther eis some errors on that code,My fixed code :
pawn Код:
CMD:skin(playerid,params[])
{
      new skinid;
      if(sscanf(params,"i",skinid)) SendClientMessage(playerid,"Usage:/setskin [skinid]");
      else if(skinid < 0 || skinid > 311) return SendClientMessage(playerid, -1, "Invalid skin!");
      else SetPlayerSkin(playerid, skinid);
      return 1;
}
And i fixed 4 errors,still got 2:
D:\Programmes\Engabic Blood Server\gamemodes\EABS.pwn(393) : error 017: undefined symbol "sscanf"
D:\Programmes\Engabic Blood Server\gamemodes\EABS.pwn(393) : error 035: argument type mismatch (argument 2)
Download sscanf include and add this line in top of your gamemode.

pawn Код:
#include <sscanf>
sscanf link: https://dl.dropboxusercontent.com/u/...canf-2.8.2.zip

Don't also forget to put it in plugins.
Reply
#10

Now i have got the error 035:argument type mismatch on he same code above(that is the line
pawn Код:
if(sscanf(params,"i",skinid)) SendClientMessage(playerid,"Usage:/setskin [skinid]");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)