07.07.2014, 15:29
Hi there. I have these codes on ondialogresponse.
you can see, if player is changing gang, he only can get a skin. what should I do to set my skins random from onplayerspawn
Help me fast pls.
pawn Код:
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case DIALOG_GANGCHANGE:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
if(PlayerInfo[playerid] [pTeam] == 0) return SendClientMessage(playerid, -1, "You cannot select the same gang.");
SetPlayerTeam(playerid, 0);
PlayerInfo[playerid][pTeam] = 0;
SetSpawnInfo( playerid, 0,186, 2022.1766,1007.5810,10.8203,270.0330, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
SendClientMessage(playerid, -1, "Your new gang is {0xAA3333AA}Red Dragon Triad.");
}
case 1: // The second item listed
{
if(PlayerInfo[playerid] [pTeam] == 1) return SendClientMessage(playerid, -1, "You cannot select the same gang.");
SetPlayerTeam(playerid, 1);
PlayerInfo[playerid][pTeam] = 1;
SetSpawnInfo( playerid, 1, 112, 2194.3840,1676.9290,12.3672,88.4035, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
SendClientMessage(playerid, -1, "Your new gang is {COL_DARK}The Corleone Family.");
}
}
}
}
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid] [pTeam] == 0)
{
SetSpawnInfo( playerid, 0,117, 2022.1766,1007.5810,10.8203,270.0330, 0, 0, 0, 0, 0, 0 );
SetSpawnInfo( playerid, 0,118, 2022.1766,1007.5810,10.8203,270.0330, 0, 0, 0, 0, 0, 0 );
SetSpawnInfo( playerid, 0,120, 2022.1766,1007.5810,10.8203,270.0330, 0, 0, 0, 0, 0, 0 );
SetSpawnInfo( playerid, 0,186, 2022.1766,1007.5810,10.8203,270.0330, 0, 0, 0, 0, 0, 0 );
SetSpawnInfo( playerid, 0,208, 2022.1766,1007.5810,10.8203,270.0330, 0, 0, 0, 0, 0, 0 );
AddPlayerClass(118,2022.1766,1007.5810,10.8203,270.0330,0,0,0,0,0,0); // four dragons spawn
}
if(PlayerInfo[playerid] [pTeam] == 1)
{
SetSpawnInfo( playerid, 1, 113, 2194.3840,1676.9290,12.3672,88.4035, 0, 0, 0, 0, 0, 0 );
SetSpawnInfo( playerid, 1, 111, 2194.3840,1676.9290,12.3672,88.4035, 0, 0, 0, 0, 0, 0 );
SetSpawnInfo( playerid, 1, 112, 2194.3840,1676.9290,12.3672,88.4035, 0, 0, 0, 0, 0, 0 );
SetSpawnInfo( playerid, 1, 46, 2194.3840,1676.9290,12.3672,88.4035, 0, 0, 0, 0, 0, 0 );
SetSpawnInfo( playerid, 1, 98, 2194.3840,1676.9290,12.3672,88.4035, 0, 0, 0, 0, 0, 0 );
AddPlayerClass(46,2194.3840,1676.9290,12.3672,88.4035,0,0,0,0,0,0); // corleone spawn
}
return 1;
}