Jump to content
  • 0

/skin nu merge cum trebuie!


aditzu1001

Question

Commanda /skin care am facuto eu dupa un tutorial de pe sa-mp.com nu merge cum trebuie.

De exemplu daca scriu /skin 101 imi da ServerUnkownCommand sau daca scriu /skin 1 imi da skinu 0 a lui cj si cand las liber imi scrie messaju de folosire.....

if (strcmp("/skin", cmdtext, true, 10) == 0)

{

new tmp[256];

tmp = strtok ( cmdtext, idx );

if ( !strlen ( tmp ) )

{

SendClientMessage(playerid, COLOR_RED, "Usage: /skin [iD]");

return 1;

}

SetPlayerSkin(playerid, strval(tmp));

//Do Something here

return 1;

}

Nu stiu ce sa ii fac am incercat sa iau comanda de la alt gamemode dar face la fel :(

Multumesc anticipat oricui ma poate ajuta!

Doomsday is in everyday of school not on the day of 2012 the school kills all of us not just the kids|!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Vezi daca merge asta :)

	if(strcmp(cmd, "/setskin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setskin [skin id]");
				return 1;
			}
			new health;
			tmp = strtok(cmdtext, idx);
			health = strval(tmp);
			if(health > 299 || health < 1) { SendClientMessage(playerid, COLOR_GREY, "Acest skin nu exista!"); return 1; }
			if(IsPlayerConnected(playerid))
			{
				PlayerInfo[playerid][pModel] = health;
				PlayerInfo[playerid][pChar] = health;
				SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
			}//not connected
		}
		return 1;
	}

i0418xcttya707ofg.jpg

Link to comment
Share on other sites

Vezi daca functioneaza asta.


if (strcmp(cmd, "/skin", true) == 0 )
    {
        new skin[256];
        skin = strtok(cmdtext, idx);
        if (!strlen(skin))
        {
            SendClientMessage(playerid, COLOR_RED, "Foloseste: /skin [skinid]");
            return 1;
        }
        new newskin = strval(skin);
        if ((newskin < 0) || (newskin > 299) || IsInvalidSkin(newskin))
        {
            SendClientMessage(playerid, COLOR_RED, "Acest skin nu exista!");
            return 1;
        }
        if (GetPlayerMoney(playerid) >= 0)
        {
            SetPlayerSkin(playerid, newskin);
            GivePlayerMoney(playerid,-0);
            format(string, 128, "Skinul tau a fost schimbat cu succes. ID-ul noului skin este %d", newskin);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "Nu poti sa-ti schimb skinul");
        }
        return 1;
}

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.