AddPlayerClass by Name HELP
#1

Код:
public OnGameModeInit()
{
	SetGameModeText("Zombies");
  	UsePlayerPedAnims();

	AddPlayerClass(287,291.6556,2035.5938,17.6406,235.3867,24,100,27,200,31,500);	// Armybase Soldier 0
	AddPlayerClass(70,-1929.2389,640.1990,46.5625,14.7999,0,0,0,0,0,0); 			// Zombo Professor 1
	AddPlayerClass(285,-1929.1486,730.7249,45.2969,211.4319,24,100,27,200,31,500); 	// Zombo 2     2
	AddPlayerClass(111,2190.8342,1676.8771,11.7806,211.4319,24,100,27,200,31,500);	// Cagatay     3
	AddPlayerClass(100,-79.5447,1385.6934,16.9389,211.4319,24,100,27,200,31,500);  // deifnace     4

	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1960.9000, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, MAX_PLAYER_NAME);

	if( (classid == 3) && (!strcmp(name, "[HLF]Cagatay")) ) return 1;
	else SendClientMessage(playerid, COLOR_RED, "This class is locked");

	if( (classid == 4) && (!strcmp(name, "[HLF]Defiance")) ) return 1;
	else SendClientMessage(playerid, COLOR_RED, "This class is locked");

	return 1;
}
er idk whats wrong here but its not working good, even if i join with Name [HLF]Cagatay it says this class is locked for all skins, but it must only be locked for other people with different nicks, and they shouldnt be able to spawn as classid 3 and 4, how to make it working?? HELP



sorry for my bad english
Reply
#2

new playerid;
lol don't put things for individual players in ongamemodeinit, this never won't work... NEVER EVER!
try it in OnPlayerRequestClass
Reply
#3

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1960.9000, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "[HLF]Cagatay") == 0)
{
AddPlayerClass(111,2190.8342,1676.8771,11.7806,211 .4319,24,100,27,200,31,500);
}
if(strcmp(name, "[HLF]Defiance") == 0)
{
AddPlayerClass(100,-79.5447,1385.6934,16.9389,211.4319,24,100,27,200,3 1,500);
}
return 1;
}



i maked like that now i cant see the skin on selection
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)