Spawn Help
#1

Well basically I have followed everything in this tutorial:

https://sampforum.blast.hk/showthread.php?tid=346614


PAWNO compiles perfectly , but when you log on , you appear to be "CJ" just flying through the floor in palomino or blueberry. Is there any reason?

pd: there are no errors
Reply
#2

Show your OnPlayerSpawn callback
Reply
#3

Show both OnGameModeInit() and OnPlayerSpawn callbacks. You may have not completed, or removed the AddPlayerClass lines.

https://sampwiki.blast.hk/wiki/AddPlayerClass
Reply
#4

pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("SFH ");
    DisableInteriorEnterExits(); //disables default interiors//
    EnableStuntBonusForAll(0); //0 to disable, 1 to enable//
    //classes//
    AddPlayerClass(266,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); //Grove Street member 0 Civilian
        AddPlayerClass(267,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); //Police Officer (1)
    return 1;
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    switch(classid) // Switching between the classids
    {
         case 0/* The first classid is of the cops*/:
         {
              SetPlayerTeam(playerid, COP); // Setting players team
              GameTextForPlayer(playerid, "~b~Cops", 1000, 3); // Screen msg for player to show what team
          }

         case 1/* The second classid is of the criminals*/:
         {
              SetPlayerTeam(playerid, CIVILIAN); // Same as above
              GameTextForPlayer(playerid, "~r~Civilian, 1000", 3); // Same as above
          }
     }
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
   if(GetPlayerTeam(playerid) == COP)
    {
        SetPlayerColor(playerid, COP_COLOUR); // Set his color to CopsColor (BLUE)
           /* Any other bonus you want for Cops team! A special gun, skin, color, attachedobject, A random spawn! */
    }

    else if(GetPlayerTeam(playerid) ==CIVILIAN)
    {
        SetPlayerColor(playerid, CIVILIAN_COLOUR);  // Same as above but in this case, CriminalsColor (RED)
    }
   return 1;
}
.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)