SA-MP Forums Archive
Class - 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)
+--- Thread: Class (/showthread.php?tid=664509)



Class - KamilPolska - 02.03.2019

Hello. I have this problem text GameTextForPlayer does not display at skin ID 1.

Код:
new Truckers[][1] = { {1}, {2}, {5} };

public OnGameModeInit()
{
    for(new i = 0; i <= sizeof(Truckers)-1; i++)
    {
	AddPlayerClass(Truckers[i][0], 0.0, 0.0, 0.0, 0.0, -1, -1, -1, -1, -1, -1);
    }
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case sizeof(Truckers)-1:
        {
            GameTextForPlayer(playerid, "Trucker", 3000, 4);
        }
    }
    return 1;
}



Re: Class - PPC23 - 02.03.2019

Class IDs start from 0
https://sampwiki.blast.hk/wiki/AddPlayerClass


Re: Class - KamilPolska - 02.03.2019

Yes, but I want to do it for skins ID 1, 2 and 5. I do not know where the problem lies, but it's definitely the code.
Код:
new Truckers[][1] = { {1}, {2}, {5} };

for(new i = 0; i <= sizeof(Truckers) -1; i++)

AddPlayerClass(Truckers[i][0], 0.0, 0.0, 0.0, 0.0, -1, -1, -1, -1, -1, -1);

case sizeof(Truckers) -1: