[PEDIDO] Comando /skin -
BurnouT_ - 15.11.2010
Alguйm me ajuda aqui o0 '-'
To precisando de algum FilterScript com o comando /skin [id-da-skin] que quando qualquer player digite Ex.: /skin 122 apareзa o Skin do ID 122...
Alguйm se tiver cуdigo ou filterscript, posta ele aqui
Re: [PEDIDO] Comando /skin -
[]Fabricio[] - 15.11.2010
pawn Код:
if(strcmp(cmd,"/skin",true) == 0)
{
new skin;
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFFFF, "Use /skin [ID-DA-SKIN]");
if((strval(tmp) < 0) || (strval(tmp) > 299)) return SendClientMessage(playerid, 0xFFFFFFFF, "As skins sгo de 0 atй 299!");
skin=strval(tmp);
SetPlayerSkin(playerid,skin);
return 1;
}
Caso dк warning, crie
Re: [PEDIDO] Comando /skin -
BurnouT_ - 15.11.2010
Deu errors de tmp, cmdtext e cmd
Daн criei essas 3 news abaixo de
new skin;
new cmd[256];
new tmp;
new cmdtext;
Daн dб esses erros:
pawn Код:
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13113) : error 017: undefined symbol "cmd"
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13119) : error 035: argument type mismatch (argument 1)
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13119) : error 006: must be assigned to an array
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13120) : error 035: argument type mismatch (argument 1)
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13121) : error 035: argument type mismatch (argument 1)
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13122) : error 035: argument type mismatch (argument 1)
e mais 3 warnings ai...
Cуdigo...
pawn Код:
if(strcmp(cmd,"/skin",true) == 0)
{
new skin;
new cmd[256];
new tmp;
new cmdtext;
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_VERMELHO, "Use /skin [ID-DA-SKIN]");
if((strval(tmp) < 0) || (strval(tmp) > 299)) return SendClientMessage(playerid, 0xFF0000FF, "As skins sгo de 0 atй 299!");
skin=strval(tmp);
SetPlayerSkin(playerid,skin);
return 1;
}
Com essas new ai me manda o cуdigo certo ;X
Re: [PEDIDO] Comando /skin -
[Ips]Guh - 15.11.2010
tenta assim :
Код:
if (strcmp(cmd, "/skin", true) == 0)
{
if(gPlayerLogged[playerid] != 0)
{
tmp = strtok(cmdtext, idx);
new skin;
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "/skin [skinid]");
return 1;
}
skin = strval(tmp);
for(new i=0;i<sizeof(JoinPed);i++) {
if(skin == JoinPed[i][0] || skin < 0 || skin > 299) {
SendClientMessage(playerid, COLOR_WHITE, "ID Inexistente ou vocк nгo pode usб-lo.");
return 1;
}
}
if(skin==1 || skin==3 || skin==4 || skin==5 || skin==6 || skin==8 || skin==42 || skin==65 || skin==74 || skin==86 || skin==119 || skin==149 || skin==208 || skin==273 || skin==289|| skin==114 || skin==111 || skin==112|| skin==113 || skin==120 || skin==125
/*|| skin==295*/||skin==286||skin==228||skin==147||skin==294||skin==17||skin==189||skin==270||skin==272||skin==271||skin==267||skin==265||skin==266||skin==269||skin==115||skin==116||skin==173
||skin==104||skin==102||skin==103||skin==107||skin==106||skin==105||skin==189||skin==194||skin==172||skin==61||skin==153||skin==287||skin==248||skin==247||skin==254||skin==100||skin==174||skin==175) {
SendClientMessage(playerid, COLOR_WHITE, "ID Inexistente ou vocк nгo pode usб-lo.");
return 1;
}
SetPlayerSkin(playerid, skin);
PlayerInfo[playerid][pModel] = skin;
} else { SendClientMessage(playerid, COLOR_GRAD1, "Autentique-se antes !"); }
}
e caso queira que quando o player trocar de skin ser cobrado alguma taxa coloque
Код:
GivePlayerGP(playerid, -50);
e mudo o 50 aki em cima/\ pelo valor desejado.
depois de
Код:
SetPlayerSkin(playerid, skin);
PlayerInfo[playerid][pModel] = skin;
Re: [PEDIDO] Comando /skin -
BurnouT_ - 15.11.2010
Viixe, ainda dб errors ;X
pawn Код:
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13113) : error 017: undefined symbol "cmd"
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13115) : error 017: undefined symbol "gPlayerLogged"
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13115) : error 001: expected token: ";", but found "]"
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13115) : error 029: invalid expression, assumed zero
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13115) : fatal error 107: too many error messages on one line
Re: [PEDIDO] Comando /skin -
BurnouT_ - 15.11.2010
@DoublePost
Qualquer 1 dos dois cуdigos indicado por vocкs dando certo e funfando legal ta bom demais
Re: [PEDIDO] Comando /skin -
TiagoPS - 15.11.2010
pawn Код:
if(strcmp(cmd, "/skin", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USO: /skin [ID Skin]");
return 1;
}
new IDSkin;
IDSkin = strval(tmp);
SetPlayerSkin(playerid, IDSkin);
return 1;
}
Re: [PEDIDO] Comando /skin -
BurnouT_ - 15.11.2010
Dб mesma forma deu error, o comando mais ъtil para mim foi o do Fabrнcio, coloquei umas news em OnPlayerCommandText
e o seguinte cуdigo:
pawn Код:
if(strcmp(cmd,"/skin",true) == 0)
{
new skin;
new cmd;
new tmp[256];
new cmdtext[256];
new idx;
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_VERMELHO, "Use /skin [ID-DA-SKIN]");
if((strval(tmp) < 0) || (strval(tmp) > 299)) return SendClientMessage(playerid, 0xFF0000FF, "As skins sгo de 0 atй 299!");
skin=strval(tmp);
SetPlayerSkin(playerid,skin);
return 1;
}
E agora sу dб um error:
pawn Код:
D:\Matheus\Elite X-TreMe Games\gamemodes\xtremedm.pwn(13113) : error 017: undefined symbol "cmd"
Esse erro й nessa linha:
pawn Код:
if(strcmp(cmd,"/skin",true) == 0)
Re: [PEDIDO] Comando /skin -
BurnouT_ - 15.11.2010
@DoublePost
Alguйem? *-*
Re: [PEDIDO] Comando /skin -
Falcon. - 16.11.2010
No Comeзo do OnPlayerCommandText
pawn Код:
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);