Wednesday, November 17, 2010

SAMP Scripting Tutorial: Skip Class Selection | Save Player's Skin

Here is the code

// Variable Declaration
new bool:newPlayer = false;

// Spawn Function
public Spawn(playerid)
{
 SpawnPlayer(playerid);
 SetPlayerSkin(playerid, strval(ReadPlayer(2,playerid)));
}

// OnPlayerRequestClass
if(newPlayer)
{
 SetPlayerPos(playerid, 1544.7887,-1675.4630,13.5591);
 SetPlayerFacingAngle(playerid,90.0);
 SetPlayerCameraPos(playerid, 1541.5293,-1675.4012,13.5527);
 SetPlayerCameraLookAt(playerid, 1544.7887,-1675.4630,13.5591);
}
else
{
 SetTimerEx("Spawn",1,false,"i",playerid);
}

// OnPlayerSpawn
if(newPlayer)
{
 new skin[4];
 valstr(skin,GetPlayerSkin(playerid));
 WritePlayer(skin,playerid,false);
}

2 comments:

  1. i have a problem with the register/login system can you help ?

    ReplyDelete
  2. C:\Users\Mihai\Desktop\Galaxy-Games\gamemodes\GGRealLife0.1.pwn(120) : warning 215: expression has no effect
    C:\Users\Mihai\Desktop\Galaxy-Games\gamemodes\GGRealLife0.1.pwn(343) : error 001: expected token: "-identifier-", but found "("
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


    1 Error.

    can you please help me?:D

    ReplyDelete