Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Player spawning problems

$
0
0
Hey, i have a little problem.. Yesterday i started making a new gamemode, started from 0. I made a few things like hub, dm arena, tdm arena, freeroam arena. But only dm arena is enabled. So when i log on, it shows me the hub perfectly, but as soon as i click on it, it's supposed to spawn me. Here's what i get:

https://i.imgur.com/55hUujl.png

It shows me the spawn dialog and when i click shift the player just gets stuck and the game crashes.

Here's the code to OnPlayerSpawn:

PHP Code:

public OnPlayerSpawn(playerid)
{
        
GameTextForPlayer(playerid"~w~ENGLISH IN MAINCHAT, USE ~b~/CHAT ~w~FOR OTHER LANGUAGES!~n~~w~IF YOU DO NOT FOLLOW THE RULES YOU WILL BE ~r~BANNED"100003);
        
ResetPlayerWeapons(playerid);
        
SetCameraBehindPlayer(playerid);
        
SetPlayerInterior(playerid18);
        
SetPlayerVirtualWorld(playerid123469);
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid100);
        
SetPlayerPos(playerid1729.2920 ,-1669.4794 ,22.6151);
        
SetPlayerFacingAngle(playerid42.4700);
        
SpawnPlayer(playerid);
        
CancelSelectTextDraw(playerid);
        
HubHide(playerid);
        
TogglePlayerSpectating(playerid0);
        
SpawnPlayer(playerid);
        
ShowVersion(playerid);
        return 
1;


Here's the code for onplayerrequestclass:

PHP Code:

public OnPlayerRequestClass(playeridclassid)
{
        
ResetPlayerWeapons(playerid);
        
SetCameraBehindPlayer(playerid);
        
SetPlayerInterior(playerid18);
        
SetPlayerVirtualWorld(playerid123469);
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid100);
        
SetPlayerPos(playerid1729.2920 ,-1669.4794 ,22.6151);
        
SetPlayerFacingAngle(playerid42.4700);
        
SendClientMessage(playeridCOLOR_WHITE"");
        
SendClientMessage(playeridCOLOR_ORANGE"Arena Deathmatch: {FFFFFF}/dm /lobby");
        
ShowStats(playerid);
        
HubHide(playerid);
        
TogglePlayerSpectating(playerid0);
        
SpawnPlayer(playerid);
        return 
1;



Also here's the code to OnPlayerClickTextDraw

PHP Code:

public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == tdmarea)
    {
        
SendClientMessage(playeridCOLOR_WHITE"Disabled.");
        
HubShow(playerid);
    }
    else if(
clickedid == dmarea)
    {
        
ResetPlayerWeapons(playerid);
        
SetCameraBehindPlayer(playerid);
        
SetPlayerInterior(playerid18);
        
SetPlayerVirtualWorld(playerid123469);
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid100);
        
SetPlayerPos(playerid1729.2920 ,-1669.4794 ,22.6151);
        
SetPlayerFacingAngle(playerid42.4700);
        
SpawnPlayer(playerid);
        
CancelSelectTextDraw(playerid);
        
HubHide(playerid);
          
SpawnPlayer(playerid);
          
TogglePlayerSpectating(playerid0);
    }
    else if(
clickedid == freeroamarea)
    {
        
SendClientMessage(playeridCOLOR_WHITE"Disabled.");
    }
    return 
1;


If anyone can help me i would appreciate it, i'm stuck with this...

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>