General > Help & Resources
How to code SA-MP Pawn [Tutorial]
[MAF]Rac3r:
Yes, you need something like this:
--- Code: ---public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 0://cj
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid, -1854.4232,27.9001,1061.1436);
SetPlayerCameraPos(playerid,-1857.2335,26.3764,1061.0);
SetPlayerCameraLookAt(playerid, -1854.4232,27.9001,1061.1436);
SetPlayerFacingAngle(playerid,125.0);
}
case 1://truth
{
SetPlayerInterior(playerid,8);
SetPlayerPos(playerid, 2806.5720,-1171.5488,1025.5703);
SetPlayerCameraPos(playerid, 2809.7527,-1170.0004,1024.9);
SetPlayerCameraLookAt(playerid, 2806.5720,-1171.5488,1026.0);
SetPlayerFacingAngle(playerid,288);
}
}
return 1;
}
--- End code ---
[MAF]Sighmoan:
Ok done that and now the players spawn in a weird place, so i guess i have to set that on the onplayerspawn (or whatever, i am not in front of it now) call?
[MAF]Rac3r:
Yep, OnPlayerSpawn you need a few functions:
SetPlayerPos( player, x, y, z);
SetPlayerFacingAngle( playerid, a);
SetCameraBehindPlayer(playerid); // this resets the camera angle you set in skin select
[FSR]Ush:
Mmm, this seems interesting :)
[MAF]Sighmoan:
Will anyone be interested if i document what i do and learn so anyone else wanting to learn can use it?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version