[Ajuda] Como adicionar mais teleportes? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Como adicionar mais teleportes? (
/showthread.php?tid=492026)
Como adicionar mais teleportes? -
eNtinityGaming - 02.02.2014
Tipo nesse code sу da pra colocar 2 opзoes de teleporte, fiquei com medo de adicionar mais um else, oq eu faзo pra por atй 7 opзoes de teleporte?
pawn Code:
if(dialogid == TeleportesZumbi)
{
if(response)
{
if(listitem == 0)
{
SetPlayerPos(playerid,Float:x,Float:y,Float:z);
SendClientMessage(playerid, COLOR_RED, "[ > ] Vocк teletransportou para a Grove Street!");
return 1;
}
else if(listitem == 1)
{
SetPlayerPos(playerid,Float:x,Float:y,Float:z);
SendClientMessage(playerid, COLOR_RED, "[ > ] Vocк se teletransportou para a Estaзгo Unity!");
}
}
}
Re: Como adicionar mais teleportes? -
Gii - 02.02.2014
pawn Code:
//No comando ou coordenada:
ShowPlayerDialog(playerid, TeleportesZumbi, DIALOG_STYLE_LIST, "Teleportes", "Teleporte 1\nTeleporte 2\nTeleporte 3\nTeleporte 4\nTeleporte 5\nTeleporte 6\nTeleporte 7\nTeleporte 8\nTeleporte 9", "Ir", "");
// Em OnDialogResponse
if(dialogid == TeleportesZumbi)
{
if(response)
{
if(listitem == 0)
{
SetPlayerPos(playerid,Float:x,Float:y,Float:z);
SendClientMessage(playerid, COLOR_RED, "[ > ] Vocк teletransportou para a Grove Street!");
return 1;
}
else if(listitem == 1)
{
SetPlayerPos(playerid,Float:x,Float:y,Float:z);
SendClientMessage(playerid, COLOR_RED, "[ > ] Vocк se teletransportou para a Estaзгo Unity!");
return 1;
}
else if ( listitem == 2 ) {
// ...
}
else if ( listitem == 3 ) {
// ...
}
else if ( listitem == 4) {
// ...
}
else if ( listitem == 5 ) {
// ...
}
else if ( listitem == 6 ) {
// ...
}
else if ( listitem == 7 ) {
// ...
}
else if ( listitem == 8 ) {
// ...
}
}
}
Ъnico possнvel erro que pode dar й: input line too long (after substitutions) = Linha muito grande/extensa.
Se isso ocorrer basta usar strcat.
https://sampwiki.blast.hk/wiki/Strcat