SA-MP Forums Archive
Disabling playerclass spawn. - 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: Disabling playerclass spawn. (/showthread.php?tid=381419)



Disabling playerclass spawn. - MrPlatinum - 29.09.2012

To disable a certain spawn for a class would i have to change,

Код HTML:
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -525.0, -502.0, 26.0, 0.0, 0, 0, 0, 0, 0, 0);
to

Код HTML:
case 0: SetSpawnInfo(playerid, 1, GetPlayerSkin(playerid), -525.0, -502.0, 26.0, 0.0, 0, 0, 0, 0, 0, 0);
?


Re: Disabling playerclass spawn. - Necro[ABK] - 29.09.2012

Quote:
Originally Posted by MrPlatinum
Посмотреть сообщение
To disable a certain spawn for a class would i have to change,

Код HTML:
case 0: SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), -525.0, -502.0, 26.0, 0.0, 0, 0, 0, 0, 0, 0);
to

Код HTML:
case 0: SetSpawnInfo(playerid, 1, GetPlayerSkin(playerid), -525.0, -502.0, 26.0, 0.0, 0, 0, 0, 0, 0, 0);
?

all that will do is change their team -_-

you need to do something like this, note this is only a quick script for example, not a copy paste thing
Код:
new myClass[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
    myClass[playerid]=classid;
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    if(myClass[playerid]==CLASS_TO_BE_DISABLED){
        return 0;
    }
    return 1;
}