SpawnPlayer(playerid) doesn't call OnPlayerSpawn
#1

Yeah, that's the problem.

My OnPlayerSpawn
pawn Code:
public OnPlayerSpawn(playerid)
{
    print("Onplayerspawn!");
    TogglePlayerSpectating(playerid,0);
    SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
    return 1;
}
And a snippet where SpawnPlayer(playerid) is:
pawn Code:
//mysql field fetching
    }
    mysql_free_result();
    SpawnPlayer(playerid);
    SetPlayerName(playerid, SubAccount[playerid][Nick]);
    SendClientMessage(playerid, GREEN, "Welcome and have fun ;)");
}
Everything else, works just fine...Even SetPlayerName is reporting, that it changes the name, and I can see under the tab that my name has been changed. OnPLayerSpawn is just a random code..and imho it should work very well. There is even a debug print..but this doesn't show on console..

Anybody, any help ?
Reply
#2

Put

OnPlayerSpawn(playerid);

underneath. This will call it.
Reply
#3

Oh well, that was easy, but still having problem, that player doesn't spawn..
Is there any additional information needed to create proper spawn ?

-e- Got it working right now...Needed SetSpawnInfo under OnPlayerSpawn(playerid).
Reply
#4

I got same problem but when I have done it i got this :


C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 213: tag mismatch
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 213: tag mismatch
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
C:\DOCUME~1\Emrah\Desktop\BONECO~1\GAMEMO~1\Bone.p wn(117) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


11 Warnings.

And this is OnPlayerSpawn :

public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, -215.35397338867, 2660.6062011719, 62.664253234863);
SetSpawnInfo(playerid, -215.35397338867, 2660.6062011719, 62.664253234863);
SetPlayerHealth(playerid, 50);
return 1;
}
Reply
#5

You need more arguments at the:
pawn Code:
SetSpawnInfo();
Here`s the full list of arguments:
pawn Code:
SetSpawnInfo (playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
Fill it up and it`ll be good.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)