SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 31/07/2019, 11:56 AM   #1
Moise05
Little Clucker
 
Join Date: Jul 2019
Posts: 8
Reputation: 0
Default CJ's skin at spawn

The "SetPlayerSkin" function does not work if I set it to "OnPlayerSpawn", the player receives the CJ skin (ID: 0).

Code:
public OnPlayerSpawn(playerid) {
	SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
}
Moise05 is offline   Reply With Quote
Old 31/07/2019, 12:16 PM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,160
Reputation: 73
Default Re: CJ's skin at spawn

do you have SetSpawnInfo or AddPlayerClass in gamemode?
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 31/07/2019, 04:20 PM   #3
Moise05
Little Clucker
 
Join Date: Jul 2019
Posts: 8
Reputation: 0
Default Re: CJ's skin at spawn

Quote:
Originally Posted by Mugala View Post
do you have SetSpawnInfo or AddPlayerClass in gamemode?
Just AddPlayerClass at OnGameModeInit

Code:
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
Moise05 is offline   Reply With Quote
Old 01/08/2019, 10:48 AM   #4
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,160
Reputation: 73
Default Re: CJ's skin at spawn

is player spawning at correct cords?
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 01/08/2019, 12:23 PM   #5
Moise05
Little Clucker
 
Join Date: Jul 2019
Posts: 8
Reputation: 0
Default Re: CJ's skin at spawn

Yes, when I log in it spawn me at the coordinates above.

EDIT: I can give you some code, if you need.
Moise05 is offline   Reply With Quote
Old 01/08/2019, 02:01 PM   #6
Gforcez
Gangsta
 
Gforcez's Avatar
 
Join Date: Jul 2010
Location: The Netherlands.
Posts: 763
Reputation: 435
Default Re: CJ's skin at spawn

Are you sure pSkin is set?
__________________

Gforcez is offline   Reply With Quote
Old 01/08/2019, 02:04 PM   #7
Robson04
Big Clucker
 
Robson04's Avatar
 
Join Date: Aug 2018
Posts: 74
Reputation: 0
Default Re: CJ's skin at spawn

Yass, check pSkin variable. Maybe have '0'.

Try not to use a variable, check it in the num.
pawn Code:
public OnPlayerSpawn (playerid)
{
    SetPlayerSkin (playerid, 114); //spawn vla1
}
Robson04 is offline   Reply With Quote
Old 01/08/2019, 03:32 PM   #8
Moise05
Little Clucker
 
Join Date: Jul 2019
Posts: 8
Reputation: 0
Default Re: CJ's skin at spawn

Quote:
Originally Posted by Gforcez View Post
Are you sure pSkin is set?
Quote:
Originally Posted by Robson04 View Post
Yass, check pSkin variable. Maybe have '0'.

Try not to use a variable, check it in the num.
pawn Code:
public OnPlayerSpawn (playerid)
{
    SetPlayerSkin (playerid, 114); //spawn vla1
}
Oh, yes you're right, i forgot to add the Skin variable on login.

Thank you all for your help.
Moise05 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CJ skin SPAWN EvgeniyHostel1992 Scripting Help 3 15/03/2018 05:20 PM
Skin spawn Godey Scripting Help 2 12/04/2016 11:19 AM
skin help - always spawn as cj skin kbalor Scripting Help 5 10/12/2014 07:23 PM
[Ajuda] Skin por SPAWN SONEKA Português/Portuguese 1 01/05/2014 09:39 AM
Set Skin On Spawn Anthonyx3' Help Archive 11 12/01/2011 08:30 PM


All times are GMT. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.