SA-MP Forums Archive
[help] Skin commands - 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: [help] Skin commands (/showthread.php?tid=113981)



[help] Skin commands - fsnameless - 17.12.2009

ok well i made a server and i was wondering how can i make a skil command for only admins like say i wanted skin id = 116 to be under a command called /jskin how would i make that?


=P This Is An Early Thanks if you help me


Re: [help] Skin commands - Hiitch - 17.12.2009

With DCMD:

pawn Код:
dcmd_jskin(playerid, params[])
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))
    {
    SetPlayerSkin(playerid, 116);
    return 1;
    }
    else
    {
      SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
      return 1;
    }
}
Without DCMD (strtok):

pawn Код:
if(strcmp(cmd, "/jskin", 5, true) ==0)
{
  if(IsPlayerAdmin(playerid))
  {
   SetPlayerSkin(playerid, 116);
   return 1;
  }
  else
  {
   SendClientMessage(playerid, 0xFF0000FF, "You are not an admin !");
   return 1;
   }
}
the strtok is untested, if you have any problems, put them down.

for the dcmd, dont forget to put:

pawn Код:
dcmd(jskin, 5, cmdtext);
return false;
under OnPlayerCommandText.

Anyone else: If I have gotten anything wrong, feel free to correct me, as I always make mistakes.


Re: [help] Skin commands - fsnameless - 17.12.2009

for the strtok is good it just giving me a warning of tag mismatch but its all good gonna go test now =P thanks for the fast reply doesnt work in game heres a ban command for the admin filter script im using
if(strcmp("/ban", cmd, true) == 0)
{
tmp = strtok(cmdtext, idx);
if(PLVL[playerid] == 0) return SendClientMessage(playerid, red, "ERROR: You're not an admin!");
if(!strlen(tmp)) return SendClientMessage(playerid, red, "ERROR: You didn't put in an id!");
if(strval(tmp) == playerid) return SendClientMessage(playerid, red, "ERROR: You can't ban yourself!");
if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, red, "ERROR: No player with such id!");
cmdid = strval(tmp);

format(string, sizeof(string), "NOTICE: %s have banned %s from the server.", prname, idname);
SendClientMessageToAll(yellow, string);
print(string);

Ban(cmdid);
return 1;

}



Re: [help] Skin commands - fsnameless - 17.12.2009

got it
Quote:

if (strcmp(cmdtext, "/jskin" , true) == 0)
{
SetPlayerSkin(playerid, 116); // Id Of skin.
GivePlayerWeapon(playerid,31,1000); // M4. With 1 of munition.This [Ammo] not is important
SendClientMessage(playerid, 0x33AA33AA, "You Applied The Jskin");
return 1;
}

Credits xavizak