SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 13/05/2008, 05:22 AM   #1
Martin_Smith
Big Clucker
 
Join Date: Jan 2008
Posts: 120
Reputation: 0
Default skin command

i need the base of the /Skin command so you say /skin and it give you skin 272, Thanks
Martin_Smith is offline  
Old 13/05/2008, 05:35 AM   #2
BIGBOY
Big Clucker
 
Join Date: Jul 2007
Posts: 66
Reputation: 0
Default Re: skin command

if(strmp(cmdtext,"/skin"......
SetPlayerSkin(playerid,272);
BIGBOY is offline  
Old 13/05/2008, 05:41 AM   #3
Cueball
Big Clucker
 
Join Date: Jul 2007
Posts: 109
Reputation: 14
Default Re: skin command

Well, if you want the command '/skin' to give you skin 272 everytime, you can do this:
pawn Code:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/skin", cmdtext, true) == 0)
    return SetPlayerSkin(playerid, 272);

  // All your other commands.

  return 0;
}

If however, you want a command set up like '/skin [skin id]', you could try something like this:
pawn Code:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/skin", cmdtext, true) == 0)
  {
    if(strlen(cmdtext) < 7)
      return SendClientMessage(playerid, 0x33CCFFAA, "USAGE: /skin [skin id]");
    new skin = strval(cmdtext[6]);
    if(IsInvalidSkin(skin))
      return SendClientMessage(playerid, 0x33CCFFAA, "ERROR: Invalid skin id!");
    SetPlayerSkin(playerid, skin);
    return SendClientMessage(playerid, 0x33CCFFAA, "Your skin id was successfully changed.");
  }

  // All your other commands.

  return 0;
}

IsInvalidSkin(skinid)
{ // Created by Simon
// Checks whether the skinid parsed is crashable or not.

#define MAX_BAD_SKINS  14

new badSkins[MAX_BAD_SKINS] = {
3, 4, 5, 6, 8, 42, 65, 74, 86,
119, 149, 208, 273, 289
};

for (new i = 0; i < MAX_BAD_SKINS; i++) {
  if (skinid == badSkins[i]) return true;
}

return false;
}

That code uses IsInvalidSkin() by Simon. I included it, so you don't have to worry.

If you need to clarify any of the functions used, check out the wiki.

~Cueball~
Cueball is offline  
Old 13/05/2008, 05:43 AM   #4
Martin_Smith
Big Clucker
 
Join Date: Jan 2008
Posts: 120
Reputation: 0
Default Re: skin command

ffs, none of em, work, and all i need is command to change to skin 272!! lol
Martin_Smith is offline  
Old 19/12/2009, 07:49 AM   #5
CristianTdj
High-roller
 
CristianTdj's Avatar
 
Join Date: Jul 2009
Location: Andalucía, Spain.
Posts: 1,307
Reputation: 5
Default Re: skin command

Thank you Cuecumber, I needed that
__________________

CristianTdj is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command to change skin Aram555 Scripting Help 11 29/06/2012 02:50 PM
/skin command, i'm too newbie for this. Gummy Bear Help Archive 5 04/04/2010 02:11 AM
Skin command help FireFox_ Help Archive 3 23/03/2010 11:41 PM
Help with set skin command OcTeT Help Archive 10 18/03/2009 02:30 AM


All times are GMT. The time now is 03:42 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.