SA-MP Forums Archive
Spawn Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Spawn Help (/showthread.php?tid=380117)



Spawn Help - daastle - 24.09.2012

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


Re: Spawn Help - Kitten - 24.09.2012

Show your OnPlayerSpawn callback


Re: Spawn Help - clarencecuzz - 24.09.2012

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

https://sampwiki.blast.hk/wiki/AddPlayerClass


Re: Spawn Help - daastle - 24.09.2012

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;
}
.