Jump to content
  • 0

Errori /skin


ruben88

Question

Salut.am aceste errori in GM!

C:\DOCUME~1\RUBEN-PC\Desktop\ROMANI~1\ROMANI~1\GAMEMO~1\SU.pwn(4225) : warning 217: loose indentation
C:\DOCUME~1\RUBEN-PC\Desktop\server~1\server~1\GAMEMO~1\SU.pwn(4225) : error 017: undefined symbol "cmd"
C:\DOCUME~1\RUBEN-PC\Desktop\server~1\server~1\GAMEMO~1\SU.pwn(4229) : error 017: undefined symbol "strtok"
C:\DOCUME~1\RUBEN-PC\Desktop\server~1\server\GAMEMO~1\SU.pwn(4229) : error 033: array must be indexed (variable "tmp")
C:\DOCUME~1\RUBEN-PC\Desktop\ROMANI~1\ROMANI~1\GAMEMO~1\SU.pwn(4241) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
La aceasta comanda!
if(strcmp(cmd, "/setskin", true) == 0)
	{
	    new Skin;
	    new tmp[256];
		tmp = strtok(cmdtext, idx);
		Skin = strval(tmp);

		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /setskin [0 - 299]");

		if(Skin >= 300) return SendClientMessage(playerid, COLOR_GREY, "Skins: 0 - 299");

		SetPlayerSkin(playerid, Skin);

		return 1;
	}

Nu stiu cum le pot rezolva,dar...eu am o comanda in ladmin4v2 /setskin [iD] [sKIN ID] doar ca o pot folosi doar admin,si eu trebe sa le schinb mereu skinu la playeri :))! Cum le pot rezolva?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Pai tu aveai la comenzi cmd apoi dupa ce ai pus ce ti-a zis -IcE- ai schimbat in cmdtext. Pana la urma cum le lasi?

Pune-le la toate comenzile cmd inloc de cmdtext iar apoi unde vrei tu prin script, de preferat exact la sfarsit codul asta:

strtok(const stringstrtok[], &index)
{
    new length = strlen(stringstrtok);
    while ((index < length) && (stringstrtok[index] <= ' ')) { index++; }

    new offset = index, result[20];
    while ((index < length) && (stringstrtok[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = stringstrtok[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

logo.png

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

Link to comment
Share on other sites

Da acm a mers dar acm ami da erruare:

error 017: undefined symbol "idx"
La acea comanda /setskin
if(strcmp(cmd, "/setskin", true) == 0)
	{
	    new Skin;
	    new tmp[256];
Aici ->		tmp = strtok(cmdtext, idx);
		Skin = strval(tmp);

		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /setskin [0 - 299]");

		if(Skin >= 300) return SendClientMessage(playerid, COLOR_GREY, "Skins: 0 - 299");

		SetPlayerSkin(playerid, Skin);

		return 1;
	}

Lam compilat si cu pawno 0.3c dar tot erroare aia mio da!

Link to comment
Share on other sites

Greu tare era sa adaugi o amarata de linie.

if(strcmp(cmd, "/setskin", true) == 0)
{
    new Skin;
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext,idx);
    Skin = strval(tmp);
    //
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /setskin [0 - 299]");
    if(Skin >= 300) return SendClientMessage(playerid, COLOR_GREY, "Skins: 0 - 299");
    SetPlayerSkin(playerid, Skin);
    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.