03.06.2011, 15:31
pessoal queria saber como bota quando tu escolhe uma gang no dialogo ai ja seta skin da gang sem ir pra a escolha do boneco.
SetPlayerSkin(playerid, IDDASKIN);
if(strcmp(cmd, "/skin29", true) == 0)
{
SetPlayerSkin(playerid, 29);
return 1;
}
if(strcmp(cmd,"/skin",true) == 0) {
new skin;
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COR, "USE: /skin [id]");
if((strval(tmp) < 0) || (strval(tmp) > 299)) return SendClientMessage(playerid, COR_VERMELHA_ESCURA, "** As skins sгo de 0 atй 299!");
skin=strval(tmp);
SetPlayerSkin(playerid,skin);
return 1;
}
Dou credibilidade ao DraKoN que fez esse cуdigo aк
pawn Код:
Espero ter ajudado. |
#define IsInvalidSkin(%0) ((%0 == 3 || %0 == 4 || %0 == 5 || %0 == 6 || %0 == 7 || %0 == 8 || %0 == 42 || %0 == 65 || %0 == 74 || %0 == 86 || %0 == 119 || %0 == 149 || %0 == 208 || %0 == 268 || %0 == 273 || %0 == 289)?(true):(false)) //By: iGarfield
if(strcmp(cmd,"/skin",true) == 0) {
new skin;
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COR, "USE: /skin [id]");
if(IsInvalidSkin(strval(tmp)) return SendClientMessage(playerid, COR, "Id da skin invбlido");v
if((strval(tmp) < 0) || (strval(tmp) > 299)) return SendClientMessage(playerid, COR_VERMELHA_ESCURA, "** As skins sгo de 0 atй 299!");
skin=strval(tmp);
SetPlayerSkin(playerid,skin);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == EXEMPLO)
{
if(response)
{
if(listitem == 0)
{
SendClientMessage(playerid, -1, "Vocк entrou para a gang 1.");
SetPlayerSkin(playerid, IDSKIN);
}
else if(listitem == 1)
{
SendClientMessage(playerid, -1, "Vocк entrou para a gang 1.");
SetPlayerSkin(playerid, IDSKIN);
}
else if(listitem == 1)
{
SendClientMessage(playerid, -1, "Vocк entrou para a gang 1.");
SetPlayerSkin(playerid, IDSKIN);
}
return 1;
}
else return SendClientMessage(playerid, -1, "Vocк cancelou o processo de seleзгo de gang.");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_MUDAR_FACCAO) { if(response) { if(listitem) { SetPlayerTeam(playerid, cv); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 47); } else if(listitem == 1) { SetPlayerTeam(playerid, tcc); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 105); } else if(listitem == 2) { SetPlayerTeam(playerid, tcp); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 107); } else if(listitem == 3) { SetPlayerTeam(playerid, ada); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 102); } else if(listitem == 4) { SetPlayerTeam(playerid, pcc); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 109); } else if(listitem == 5) { SetPlayerTeam(playerid, pcp); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 109); } SetPlayerHealth(playerid, 0); } } else if(dialogid == DIALOG_ESCOLHE_FACCAO) { if(response) { if(listitem) { SetPlayerTeam(playerid, cv); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 47); } else if(listitem == 1) { SetPlayerTeam(playerid, tcc); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 105); } else if(listitem == 2) { SetPlayerTeam(playerid, tcp); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 107); } else if(listitem == 3) { SetPlayerTeam(playerid, ada); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 102); } else if(listitem == 4) { SetPlayerTeam(playerid, pcc); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 109); } else if(listitem == 5) { SetPlayerTeam(playerid, pcp); OnPlayerSpawn(playerid); SetPlayerSkin(playerid, 109); } } } return 1; }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_MUDAR_FACCAO)
{
if(response)
{
if(listitem)
{
SetPlayerTeam(playerid, cv);
Spawn(playerid);
SetPlayerSkin(playerid, 47);
}
else if(listitem == 1)
{
SetPlayerTeam(playerid, tcc);
Spawn(playerid);
SetPlayerSkin(playerid, 105);
}
else if(listitem == 2)
{
SetPlayerTeam(playerid, tcp);
Spawn(playerid);
SetPlayerSkin(playerid, 107);
}
else if(listitem == 3)
{
SetPlayerTeam(playerid, ada);
Spawn(playerid);
SetPlayerSkin(playerid, 102);
}
else if(listitem == 4)
{
SetPlayerTeam(playerid, pcc);
Spawn(playerid);
SetPlayerSkin(playerid, 109);
}
else if(listitem == 5)
{
SetPlayerTeam(playerid, pcp);
Spawn(playerid);
SetPlayerSkin(playerid, 109);
}
SetPlayerHealth(playerid, 0);
}
}
else if(dialogid == DIALOG_ESCOLHE_FACCAO)
{
if(response)
{
if(listitem)
{
SetPlayerTeam(playerid, cv);
Spawn(playerid);
SetPlayerSkin(playerid, 47);
}
else if(listitem == 1)
{
SetPlayerTeam(playerid, tcc);
Spawn(playerid);
SetPlayerSkin(playerid, 105);
}
else if(listitem == 2)
{
SetPlayerTeam(playerid, tcp);
Spawn(playerid);
SetPlayerSkin(playerid, 107);
}
else if(listitem == 3)
{
SetPlayerTeam(playerid, ada);
Spawn(playerid);
SetPlayerSkin(playerid, 102);
}
else if(listitem == 4)
{
SetPlayerTeam(playerid, pcc);
Spawn(playerid);
SetPlayerSkin(playerid, 109);
}
else if(listitem == 5)
{
SetPlayerTeam(playerid, pcp);
Spawn(playerid);
SetPlayerSkin(playerid, 109);
}
}
}
return 1;
}