SA-MP Forums Archive
Apply Skin, color, weapons, etc... offer rep++ :D - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Apply Skin, color, weapons, etc... offer rep++ :D (/showthread.php?tid=309424)



Apply Skin, color, weapons, etc... offer rep++ :D - Edvin - 07.01.2012

Hi, i have a big problem.
I make clans system, with clan personal: color, weapons, skin, leader skin, ... and i have a problem when player spawn, the color, weapons, skin and leader skin don't apply to the player ... I don't know what are the problem.

Here is the code ... maybe i script something wrong...
Код:
public OnPlayerSpawn( playerid )
{
    format( pFile, sizeof( pFile ), "Clans/%s.ini", PlayerName( playerid ) );
    format( gFile, sizeof( gFile ), "Clans/%s.ini", dini_Get( pFile, "Clan" ) );
	if ( dini_Exists( pFile ) )
	{
	    SetPlayerSkin( playerid, strval( dini_Get( gFile, "LeaderSkin" ) ) );
		SetPlayerColor( playerid, strval( dini_Get( gFile, "ClanColor" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon1" ) ), strval( dini_Get( gFile, "Ammo1" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon2" ) ), strval( dini_Get( gFile, "Ammo2" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon3" ) ), strval( dini_Get( gFile, "Ammo3" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon4" ) ), strval( dini_Get( gFile, "Ammo4" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon5" ) ), strval( dini_Get( gFile, "Ammo5" ) ) );
    }
    else
	{
	    return 1;
	}
    if ( strfind( dini_Get( gFile, "Member" ), PlayerName( playerid ), true ) != -1 )
	{
		SetPlayerSkin( playerid, strval( dini_Get( gFile, "MemberSkin" ) ) );
		SetPlayerColor( playerid, strval( dini_Get( gFile, "ClanColor" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon1" ) ), strval( dini_Get( gFile, "Ammo1" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon2" ) ), strval( dini_Get( gFile, "Ammo2" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon3" ) ), strval( dini_Get( gFile, "Ammo3" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon4" ) ), strval( dini_Get( gFile, "Ammo4" ) ) );
		GivePlayerWeapon( playerid, strval( dini_Get( gFile, "Weapon5" ) ), strval( dini_Get( gFile, "Ammo5" ) ) );
	}
    return 1;
}
PS. - On save file is saved everything what is need to save.


Re: Apply Skin, color, weapons, etc... offer rep++ :D - Edvin - 08.01.2012

Anyone?

Please i need help ...


Re: Apply Skin, color, weapons, etc... offer rep++ :D - Edvin - 08.01.2012

Bump UP!

Any sugestions? Anything ?


Re: Apply Skin, color, weapons, etc... offer rep++ :D - TheArcher - 08.01.2012

Try to do somehow else when you load beacuse i see when a player spawn, have to open x1000 the files + dini that is a terrible ini system it's going to screw up.