Jump to content
  • 0

Ma voi face de ras..


AsSsASIN

Question

public OnPlayerRequestClass(playerid, classid)
{
	new
	    loginstring[ 256 ],    loginname[ 64 ],    regstring[ 256 ],
		string[ 256 ],    escip[ 15 ],    ip[ 15 ]
	;
	GetPlayerIp(playerid, ip, 15);
	mysql_real_escape_string(ip, escip);
    GetPlayerName(playerid,loginname,sizeof(loginname));
	if (gPlayerAccount[playerid] != 0) {
		if(gPlayerLogged[playerid] == 0) {
	        format(loginstring,sizeof(loginstring),"{FFFFFF}Your IP is different, please enter your password.",loginname);
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FFFFFF}Login to the server.",loginstring,"Login", "");
		}
	} else {
		gPlayerAccount[playerid] = 0;
        format(regstring,sizeof(regstring),"{FFFFFF}Welcome on {0000FF}eXtrike Federation{FFFFFF}.\n{FFFFFF}What's up {0000FF}%s{FFFFFF}? Please enter your password.",loginname);
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FFFFFF}Login to the server.",regstring,"Register", "");
	}
	SetPlayerPos(playerid, -2482.26, -285.37, 40.54);
	SetPlayerFacingAngle(playerid, 90.00);
	SetPlayerCameraPos(playerid, -2485.67, -287.22, 42.34);
    SetPlayerCameraLookAt(playerid, -2481.59, -285.01, 40.49);
	if (classid == 0)
	{
        SetPlayerSkin(playerid, 180);
	    format(string, sizeof(string), "~r~Bloodz");
		GameTextForPlayer(playerid,string,3500,6);
	}
    else if (classid == 1)
	{
        SetPlayerSkin(playerid, 67);
	    format(string, sizeof(string), "~r~Bloodz");
		GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 2)
	{
        SetPlayerSkin(playerid, 297);
	    format(string, sizeof(string), "~b~Cripz");
		GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 3)
	{
        SetPlayerSkin(playerid, 21);
	    format(string, sizeof(string), "~b~Cripz");
		GameTextForPlayer(playerid,string,3500,6);
	}
	else classid = 0;
	SetPlayerTeamFromClass(playerid,classid);
	return 1;
}

public SetPlayerTeamFromClass(playerid,classid)
{
 	if (classid == 0)
	{
        SetPlayerSkin(playerid, 180);
        PlayerInfo[playerid][pGangTeam] = 1;
	}
 	else if (classid == 1)
	{
        SetPlayerSkin(playerid, 67);
        PlayerInfo[playerid][pGangTeam] = 1;
	}
 	else if (classid == 2)
	{
        SetPlayerSkin(playerid, 297);
        PlayerInfo[playerid][pGangTeam] = 2;
	}
 	else if (classid == 3)
	{
        SetPlayerSkin(playerid, 21);
        PlayerInfo[playerid][pGangTeam] = 2;
	}

}

Ma fac de ras, dar asta este.

Deci, dupa verificarea classid 3, 'trece la al 4' care nu exista, si tot asa 4,5,6,7,8 infinit, nu stiu cum doamne iarta-ma face asa, ca normal trebuia sa se intoarca la classid 0...

Blank GM on mysql...

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

N-are cum sa continue pana la infinit, dar poate pana la un numar mai mare, vezi sa ai DOAR 4 AddPlayerClass-uri sub OnGameModeInit.

Si pune si asa:

public OnPlayerRequestClass(playerid, classid)
{
	new
	    loginstring[ 256 ],    loginname[ 64 ],    regstring[ 256 ],
		string[ 256 ],    escip[ 15 ],    ip[ 15 ]
	;
	GetPlayerIp(playerid, ip, 15);
	mysql_real_escape_string(ip, escip);
    GetPlayerName(playerid,loginname,sizeof(loginname));
	if (gPlayerAccount[playerid] != 0) {
		if(gPlayerLogged[playerid] == 0) {
	        format(loginstring,sizeof(loginstring),"{FFFFFF}Your IP is different, please enter your password.",loginname);
            ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FFFFFF}Login to the server.",loginstring,"Login", "");
		}
	} else {
		gPlayerAccount[playerid] = 0;
        format(regstring,sizeof(regstring),"{FFFFFF}Welcome on {0000FF}eXtrike Federation{FFFFFF}.\n{FFFFFF}What's up {0000FF}%s{FFFFFF}? Please enter your password.",loginname);
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{FFFFFF}Login to the server.",regstring,"Register", "");
	}
	SetPlayerPos(playerid, -2482.26, -285.37, 40.54);
	SetPlayerFacingAngle(playerid, 90.00);
	SetPlayerCameraPos(playerid, -2485.67, -287.22, 42.34);
    SetPlayerCameraLookAt(playerid, -2481.59, -285.01, 40.49);
	if (classid == 0)
	{
        SetPlayerSkin(playerid, 180);
	    format(string, sizeof(string), "~r~Bloodz");
		GameTextForPlayer(playerid,string,3500,6);
	}
    else if (classid == 1)
	{
        SetPlayerSkin(playerid, 67);
	    format(string, sizeof(string), "~r~Bloodz");
		GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 2)
	{
        SetPlayerSkin(playerid, 297);
	    format(string, sizeof(string), "~b~Cripz");
		GameTextForPlayer(playerid,string,3500,6);
	}
	else if (classid == 3)
	{
        SetPlayerSkin(playerid, 21);
	    format(string, sizeof(string), "~b~Cripz");
		GameTextForPlayer(playerid,string,3500,6);
	}
	SetPlayerTeamFromClass(playerid,classid);
	return 1;
}

public SetPlayerTeamFromClass(playerid,classid)
{
 	if (classid == 0)
	{
        SetPlayerSkin(playerid, 180);
        PlayerInfo[playerid][pGangTeam] = 1;
	}
 	else if (classid == 1)
	{
        SetPlayerSkin(playerid, 67);
        PlayerInfo[playerid][pGangTeam] = 1;
	}
 	else if (classid == 2)
	{
        SetPlayerSkin(playerid, 297);
        PlayerInfo[playerid][pGangTeam] = 2;
	}
 	else if (classid == 3)
	{
        SetPlayerSkin(playerid, 21);
        PlayerInfo[playerid][pGangTeam] = 2;
	}
}
else classid = 0;

nu prea-si avea rostul.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.