Jump to content
  • 0

[GF/RP] Problema /factionspawn


ToX1c

Question

Salut am si eu o mare problema la comanda /factionspawn cand sunt pe sv si dau /factionspawn LS si dau respawn totul merge bine , cand dau restart la server nu ma da in LS ma da in SF..Ce pot sa fac cand dau /factionspawn LS si sting serverul sa ma dea tot in LS.

2.Cum fac la /factionspawn sa pun la mai multe factiunii. de ex sa poata sa dea si medicii /factionspawn LS/SF.Multumesc

if (strcmp("/factionspawn", cmdtext, true,11) == 0) 
{ 
if(IsPlayerConnected(playerid)) 
{ 
if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) 
{ 
x_nr = strtok(cmdtext, idx); 
if(!strlen(x_nr)) 
{ 
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /factionspawn [SF/LS]"); 
return 1; 
} 
if(strcmp(x_nr,"SF",true) == 0) 
{ 
SchoolSpawn[playerid] = 0; 
SendClientMessage(playerid, COLOR_WHITE, "Spawn-ul tau a fost setat in SF"); 
return 1; 
} 
else if(strcmp(x_nr,"LS",true) == 0) 
{ 
SchoolSpawn[playerid] = 1; 
SendClientMessage(playerid, COLOR_WHITE, "Spawn-ul tau a fost setat in LS"); 
return 1; 
} 
} 
else 
{ 
SendClientMessage(playerid, COLOR_GREY, "Nu faci parte din School Instructor !"); 
} 
} 
return 1; 
}

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

1.Cauta pLevel, dedesupt adauga:[pawn]pSpawn,[/pawn]

2.Cauta PlayerInfo[playerid][pLevel] = 0; si sub adaugi : [pawn]PlayerInfo[playerid][pSpawn] = 0;[/pawn]

3.Cauta format(var, 32, "Level=%d\n", si sub adaugi:[pawn] format(var, 32, "Spawn=%d\n",PlayerInfo[playerid][pSpawn]);fwrite(hFile, var);[/pawn]

4.Fa din nou punctul 3 . (vei gasi doua lafel).

5.Cauta if( strcmp( key , "Level" , true ) si sub adauga: [pawn]if( strcmp( key , "Spawn" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSpawn] = strval( val ); }[/pawn]

Dupaia la SetPlayerSpawn(playerid); adaugi:

[pawn]

if(PlayerInfo[playerid][pSpawn] == 1)

{

SchoolSpawn[playerid] = 0;

}

if(PlayerInfo[playerid][pSpawn] == 2)

{

SchoolSpawn[playerid] = 1;

}

[/pawn]

[pawn]

if (strcmp("/factionspawn", cmdtext, true,11) == 0)

{

if(IsPlayerConnected(playerid))

{

if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)

{

x_nr = strtok(cmdtext, idx);

if(!strlen(x_nr))

{

SendClientMessage(playerid, COLOR_WHITE, "USAGE: /factionspawn [sF/LS]");

return 1;

}

if(strcmp(x_nr,"SF",true) == 0)

{

SchoolSpawn[playerid] = 0;

PlayerInfo[playerid][pSpawn] = 1;

SendClientMessage(playerid, COLOR_WHITE, "Spawn-ul tau a fost setat in SF");

return 1;

}

else if(strcmp(x_nr,"LS",true) == 0)

{

SchoolSpawn[playerid] = 1;

PlayerInfo[playerid][pSpawn] = 2;

SendClientMessage(playerid, COLOR_WHITE, "Spawn-ul tau a fost setat in LS");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Nu faci parte din School Instructor !");

}

}

return 1;

}

[/pawn]

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

Tot nu merge am facut ce ai zis si tot nu merge...

if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)  //Driving/Flying School spawn
	    {
			if(SchoolSpawn[playerid] == 0)
			{
		        SetPlayerToTeamColor(playerid);
				SetPlayerPos(playerid, -2032.6810,-117.4816,1035.1719);
				SetPlayerFacingAngle(playerid, 275.1114);
				SetPlayerInterior(playerid,3);
				PlayerInfo[playerid][pInt] = 3;
			}
			else if(SchoolSpawn[playerid] == 1)
			{
				SetPlayerToTeamColor(playerid);
				SetPlayerPos(playerid, 2050.9392,-1901.1844,13.9121);
				SetPlayerFacingAngle(playerid, 4.6505);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
			}
	        return 1;
	    }
	    if(PlayerInfo[playerid][pSpawn] == 1)
        {
	       SchoolSpawn[playerid] = 0;
        }
        if(PlayerInfo[playerid][pSpawn] == 2)
        {
	       SchoolSpawn[playerid] = 1;
        }

Link to comment
Share on other sites

[pawn]     if(PlayerInfo[playerid][pSpawn] == 1)

        {

      SchoolSpawn[playerid] = 0;

        }

        if(PlayerInfo[playerid][pSpawn] == 2)

        {

      SchoolSpawn[playerid] = 1;

        }

[/pawn]

Pui la inceput de tot .

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

Tot nu merge ..

Da imi apare la cont Spawn=2 si tot nu merge..

if(HireCar[playerid] != 299)
	{
		gLastDriver[HireCar[playerid]] = 300;
		gCarLock[HireCar[playerid]] = 0;
		UnLockCar(HireCar[playerid]);
	}
	if (gLastCar[playerid] > 0)
	{
		gLastDriver[gLastCar[playerid]] = 300;
		if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
		{
			gCarLock[gLastCar[playerid]] = 0;
			UnLockCar(gLastCar[playerid]);
		}
	}
	if(PlayerInfo[playerid][pSpawn] == 1)
    {
        SchoolSpawn[playerid] = 0;
    }
    if(PlayerInfo[playerid][pSpawn] == 2)
    {
        SchoolSpawn[playerid] = 1;
    }

Link to comment
Share on other sites

if(strcmp(cmd, "/factionspawn", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 1)
            {
				x_nr = strtok(cmdtext, idx);
				if(!strlen(x_nr)) {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /factionspawn [SF/LS]");
					return 1;
				}
				if (PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
				{
			    	if(strcmp(x_nr,"SF",true) == 0)
					{
				    	PlayerInfo[playerid][pSpawn] = 0;
			        	SendClientMessage(playerid, COLOR_WHITE, "Spawn-ul tau a fost setat in SF");
					}
	            	else if(strcmp(x_nr,"LS",true) == 0)
					{
				    	PlayerInfo[playerid][pSpawn] = 1;
			        	SendClientMessage(playerid, COLOR_WHITE, "Spawn-ul tau a fost setat in LS");
					}
				}
 				if (PlayerInfo[playerid][pMember] == 50 || PlayerInfo[playerid][pLeader] == 50)
				{
			    	if(strcmp(x_nr,"SF",true) == 0)
					{
				    	PlayerInfo[playerid][pSpawn] = 0;
			        	SendClientMessage(playerid, COLOR_WHITE, "Spawn-ul tau a fost setat in SF");
					}
	            	else if(strcmp(x_nr,"LS",true) == 0)
					{
				    	PlayerInfo[playerid][pSpawn] = 1;
			       		SendClientMessage(playerid, COLOR_WHITE, "Spawn-ul tau a fost setat in LS");
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "Need to be logged in to use this command");
			    return 1;
			}
	    }
	    return 1;
	}
if (PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)  // School Instructor Spawn
		{
			if(PlayerInfo[playerid][pSpawn] == 0) // Spawn SF
			{
				SetPlayerToTeamColor(playerid);
				SetPlayerPos(playerid, -2032.6810,-117.4816,1035.1719);
				SetPlayerFacingAngle(playerid, 270.0);
				SetPlayerInterior(playerid,3);
				PlayerInfo[playerid][pInt] = 3;
				return 1;
			}
			if(PlayerInfo[playerid][pSpawn] == 1) // Spawn LS
			{
				SetPlayerToTeamColor(playerid);
				SetPlayerPos(playerid, 2050.9392,-1901.1844,13.9121);
                SetPlayerFacingAngle(playerid, 270.0);
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
				return 1;
			}
		}

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.