07.01.2012, 16:10
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...
PS. - On save file is saved everything what is need to save.
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;
}

