Problem with gamemod.
#1

I have problem with Virtual Basic RolePlay ( from scratch ), when i login in game this appears to me: Pictures

EDIT: Here is GameMode in PasteBin: PasteBin
Reply
#2

problem into ur ongamemodeinit or u did not added onplayerRequestcalss as must be.

____________________
MY SERVER:

Server forum
-------
Be$t Host for your server : HostingTime Easy control panel with 1Euro for 20 slots.
Reply
#3

1. You need to have minimum a one class added (OnGameModeInit - AddPlayerClass)
2. OnPlayerRequestClass Callback.
Reply
#4

Again same thing, can u fix it, and upload it on pastebin, only gamemod ? pls

EDIT: Fixed, can you tell me how to do that do not have to press the button "SHIFT" but to automatically spawn?

Sorry for my bad english.
Reply
#5

Well.. to do not press "SPAWN" when player connect and automaticly spawn you can use some of ****** includes (Y_Classes & Y_Groups)

I am not sure but you can i think use a function "SpawnPlayer(playerid);" in OnPlayerConnect. In OnPlayerRequestClass will not work, for sure.
Reply
#6

When i click "SHIFT" for spawn, i spawn on place but i can't move and i am in air .
Reply
#7

Because you are not setting SetPlayerPos in OnPlayerSpawn when player should be spawned.. that's why you're spawning in the air.
Reply
#8

this is my OnPlayerSpawn

Код:
public OnPlayerSpawn(playerid)
{
   	if(IsPlayerConnected(playerid))
	{
    	SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    	SetPlayerToTeamColor(playerid);
    	Logged[playerid] = 1;
	}
	if(PlayerInfo[playerid][pPos_x] == 0 && PlayerInfo[playerid][pPos_y] == 0)
    {
        SetPlayerPos(playerid, 1119.4132,-1619.1407,20.5162);
        Logged[playerid] = 1;
        SpawnPlayer(playerid);
    }
    else
	{
		SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
		Logged[playerid] = 1;
		SpawnPlayer(playerid);
 	}
	if (PlayerInfo[playerid][pMember] > 0)
	{
		switch(PlayerInfo[playerid][pMember])
		{
			case 1: // Prva organizacija, nazovimo je Los Santos Police Department
			{
				SetPlayerPos(playerid, 1525.4482,-1677.9772,5.8906); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
				SetPlayerFacingAngle(playerid, 266.9746); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
				SetPlayerSkin(playerid, PlayerInfo[playerid][pOrgSkin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
			}
			// Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju za spawn, sto je potrebno svaki put kada zelite dodati novu organizaciju
			/*case 2: // Druga organizacije, nazovimo je FBI
			{
				SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
				SetPlayerFacingAngle(playerid, 270.1425); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem

				SetPlayerSkin(playerid, PlayerInfo[playerid][pOrgSkin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
			}*/
		}
	}
	else if (PlayerInfo[playerid][pLeader] > 0)
	{
		switch(PlayerInfo[playerid][pLeader])
		{
			case 1: // Prva organizacija, nazovimo je Los Santos Police Department
			{
				SetPlayerPos(playerid, 1525.4482,-1677.9772,5.8906); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
				SetPlayerFacingAngle(playerid, 266.9746); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
				SetPlayerSkin(playerid, PlayerInfo[playerid][pOrgSkin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
			}
			// Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju za spawn, sto je potrebno svaki put kada zelite dodati novu organizaciju
			/*case 2: // Druga organizacije, nazovimo je FBI
			{
				SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
				SetPlayerFacingAngle(playerid, 270.1425); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem

				SetPlayerSkin(playerid, PlayerInfo[playerid][pOrgSkin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
			}*/
		}
	}
    return 1;
}
Reply
#9

You are making a GameMode and you don't know how to use a functions that you "created"?

The problem can be:
pawn Код:
if(PlayerInfo[playerid][pPos_x] == 0 && PlayerInfo[playerid][pPos_y] == 0)
PlayerPos (it's saved to file as i think) is other than "0" then SetPlayerPos is not working.

2. Probarly you're not a Member || Leader.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)