Oggi è 29/04/2024, 14:18

Tutti gli orari sono UTC + 1 ora [ ora legale ]



Regole del forum


- Dare titoli sensati, non titoli tipo "Aiuto" oppure "Problema", i topic analoghi verranno immediatamente chiusi.
- Utilizzare http://www.pastebin.com per script superiori a 20 righe.



 Pagina 1 di 2 [ 22 messaggi ] 

Vai alla pagina :: 1, 2  Prossima »
  Apri un nuovo argomento Questo argomento è bloccato, non puoi modificare o inviare ulteriori messaggi.

  Stampa pagina

Autore Messaggio
 Oggetto del messaggio: [REQ]goto
MessaggioInviato: 18/03/2011, 0:35 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
mi servirebbe uno script per il goto per i player che permette di gotarsi ovunque...

_________________
Immagine


Top
 E-mail  
 

 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 0:42 
Avatar utente
Utente

Iscritto il: 22/12/2010
Messaggi: 1098
Località: Agrigento (Sicilia)
Favourite GTA: San Andreas
Xfire: In PM

Karma
0


Non connesso
Gotarsi ovunque in che senso? Gotarsi in altri player? O gotarsi alle coordinate scritte?

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 0:50 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
gotarsi dai player sia che sono sui veicoli ecc..

ps: il comando non deve essere per admin.. ma per i player normali

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 1:07 
Avatar utente
Utente

Iscritto il: 31/10/2010
Messaggi: 901
Località: Universo - Via Lattea - Sistema Solare - Pianeta Terra - Europa - Italia - Sicilia - Grammichele(CT)
Favourite GTA: San Andreas
Xfire: Privato

Karma
2


Non connesso
Codice:
if(strcmp(cmdtext, "/goto", true)==0)
{
    new tmp[256];
    new Float:pos[3];
    new other[2];
    new idx;
    new str[128];
    new name[24][2];
    tmp = strtok(cmdtext, idx);
    GetPlayerPos(strval(tmp), pos[0], pos[1], pos[2]);
    GetPlayerInterior(strval(tmp), other[0]);
    GetPlayerVirtualWordl(strval(tmp), other[1]);
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SetPlayerInterior(playerid, other[0]);
    SetPlayerVirtualWordl(playerid, other[1]);
    GetPlayerName(playerid, name[0], 24);
    GetPlayerName(strval(tmp), name[1], 24);
    format(str, 128, "Il Player %s si è teletrasportato dal player %s", name[0], name[1]);
    SendClientMessageToAll(COLOR_RED, str);
    return 1;
}


Prova questo :\

_________________
Immagine


I Miei Filterscript Per Sa-Mp

Rampone System By me and Mik_Teck
Autovelox System By me and Mik_Teck
Metro System By me
pLaserPointer By me

Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 1:12 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
Codice:
C:\Users\Pavilion\Desktop\SERVER PDC\pawno\PDC.pwn(3123) : error 017: undefined symbol "strtok"
C:\Users\Pavilion\Desktop\SERVER PDC\pawno\PDC.pwn(3123) : error 033: array must be indexed (variable "tmp")
C:\Users\Pavilion\Desktop\SERVER PDC\pawno\PDC.pwn(3125) : warning 202: number of arguments does not match definition
C:\Users\Pavilion\Desktop\SERVER PDC\pawno\PDC.pwn(3126) : error 017: undefined symbol "GetPlayerVirtualWordl"
C:\Users\Pavilion\Desktop\SERVER PDC\pawno\PDC.pwn(3129) : error 017: undefined symbol "SetPlayerVirtualWordl"
C:\Users\Pavilion\Desktop\SERVER PDC\pawno\PDC.pwn(3120) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 1:20 
Avatar utente
Utente

Iscritto il: 22/12/2010
Messaggi: 1098
Località: Agrigento (Sicilia)
Favourite GTA: San Andreas
Xfire: In PM

Karma
0


Non connesso
Prova ad usare questo comando:

Codice:
if(!strcmp(cmd, "/goto", true))
{
new pid[128], Float: Pos[3]; pid = strtok(cmdtext, idx);
if(!strlen(pid)) return SendClientMessage(playerid, colore, "/goto <id>");
if(!IsPlayerConnected(strval(pid))) return SendClientMessage(playerid, rosso, "Player offline");
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(strval(pid)));
SetPlayerInterior(playerid, GetPlayerInterior(strval(pid)));
GetPlayerPos(strval(pid), Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
if(IsPlayerInAnyVehicle(strval(pid)))
{
PutPlayerInVehicle(playerid, GetPlayerVehicleID(strval(pid)), 1);
}
return 1;


Lo ho appena fatto... Spero che funzioni ;)

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 1:34 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
mi da due errori

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 13:35 
Avatar utente
Utente

Iscritto il: 31/10/2010
Messaggi: 901
Località: Universo - Via Lattea - Sistema Solare - Pianeta Terra - Europa - Italia - Sicilia - Grammichele(CT)
Favourite GTA: San Andreas
Xfire: Privato

Karma
2


Non connesso
May, riprendi il mio codice e in fondo alla GM metti:

Codice:
stock strtok(const string[], &index)
{
   new length = strlen(string);
   while ((index < length) && (string[index] <= ' '))
   {
      index++;
   }

   new offset = index;
   new result[128];
   while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }
   result[index - offset] = EOS;
   return result;
}

_________________
Immagine


I Miei Filterscript Per Sa-Mp

Rampone System By me and Mik_Teck
Autovelox System By me and Mik_Teck
Metro System By me
pLaserPointer By me

Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 14:57 
Avatar utente
Utente

Iscritto il: 22/12/2010
Messaggi: 1098
Località: Agrigento (Sicilia)
Favourite GTA: San Andreas
Xfire: In PM

Karma
0


Non connesso
Si giusto ti mancava l'strtok... Credevo fosse sottinteso includerlo. Comunque non credo che il codice di Angelo possa funzionare... Visto che molti Get sono sbagliati. Dovresti fare ad esempio:

Codice:
other[1] = GetPlayerVirtualWorld(strval(tmp));


Non puoi fare:

Codice:
GetPlayerVirtualWorld(strval(tmp), other[1]);

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 18/03/2011, 15:06 
Avatar utente
Utente

Iscritto il: 31/10/2010
Messaggi: 901
Località: Universo - Via Lattea - Sistema Solare - Pianeta Terra - Europa - Italia - Sicilia - Grammichele(CT)
Favourite GTA: San Andreas
Xfire: Privato

Karma
2


Non connesso
Giusto, mi confondo sempre in ste cose, ecco il codice corretto:

Codice:
if(strcmp(cmdtext, "/goto", true)==0)
{
    new tmp[256];
    new Float:pos[3];
    new other[2];
    new idx;
    new str[128];
    new name[24][2];
    tmp = strtok(cmdtext, idx);
    GetPlayerPos(strval(tmp), pos[0], pos[1], pos[2]);
    other[0] = GetPlayerInterior(strval(tmp));
    other[1] = GetPlayerVirtualWordl(strval(tmp));
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SetPlayerInterior(playerid, other[0]);
    SetPlayerVirtualWordl(playerid, other[1]);
    GetPlayerName(playerid, name[0], 24);
    GetPlayerName(strval(tmp), name[1], 24);
    format(str, 128, "Il Player %s si è teletrasportato dal player %s", name[0], name[1]);
    SendClientMessageToAll(COLOR_RED, str);
    return 1;
}

_________________
Immagine


I Miei Filterscript Per Sa-Mp

Rampone System By me and Mik_Teck
Autovelox System By me and Mik_Teck
Metro System By me
pLaserPointer By me

Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 02/04/2011, 20:37 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
Codice:
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3178) : error 017: undefined symbol "strtok"
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3178) : error 033: array must be indexed (variable "tmp")
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3181) : error 017: undefined symbol "GetPlayerVirtualWordl"
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3184) : error 017: undefined symbol "SetPlayerVirtualWordl"
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3175) : warning 203: symbol is never used: "idx"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 02/04/2011, 21:14 
Avatar utente
Utente

Iscritto il: 31/10/2010
Messaggi: 901
Località: Universo - Via Lattea - Sistema Solare - Pianeta Terra - Europa - Italia - Sicilia - Grammichele(CT)
Favourite GTA: San Andreas
Xfire: Privato

Karma
2


Non connesso
cambialo con questo:

Codice:
if(strcmp(cmdtext, "/goto", true)==0)
{
    new tmp[256];
    new Float:pos[3];
    new other[2];
    new idx;
    new str[128];
    new name[24][2];
    tmp = strtok(cmdtext, idx);
    GetPlayerPos(strval(tmp), pos[0], pos[1], pos[2]);
    other[0] = GetPlayerInterior(strval(tmp));
    other[1] = GetPlayerVirtualWordl(strval(tmp));
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SetPlayerInterior(playerid, other[0]);
    SetPlayerVirtualWordl(playerid, other[1]);
    GetPlayerName(playerid, name[0], 24);
    GetPlayerName(strval(tmp), name[1], 24);
    format(str, 128, "Il Player %s si è teletrasportato dal player %s", name[0], name[1]);
    SendClientMessageToAll(COLOR_RED, str);
    return 1;
}


Infondo a tutto metti:

Codice:
stock strtok(const string[], &index)
{
   new length = strlen(string);
   while ((index < length) && (string[index] <= ' '))
   {
      index++;
   }

   new offset = index;
   new result[128];
   while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }
   result[index - offset] = EOS;
   return result;
}


Prova

_________________
Immagine


I Miei Filterscript Per Sa-Mp

Rampone System By me and Mik_Teck
Autovelox System By me and Mik_Teck
Metro System By me
pLaserPointer By me

Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 02/04/2011, 21:28 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
mi da questi due errori

Codice:
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3181) : error 017: undefined symbol "GetPlayerVirtualWordl"
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3184) : error 017: undefined symbol "SetPlayerVirtualWordl"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 02/04/2011, 21:30 
Banned

Iscritto il: 31/10/2010
Messaggi: 1363
Località: Sicilia
Favourite GTA: San Andreas
Xfire: peppinux

Karma
-10


Non connesso
Sostituisci "GetPlayerVirtualWordl" e "SetPlayerVirtualWordl" con "GetPlayerVirtualWorld" e "SetPlayerVirtualWorld".


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 02/04/2011, 21:38 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
Codice:
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3181) : warning 202: number of arguments does not match definition
C:\Users\Pavilion\Desktop\Server ILV\pawno\ILV.pwn(3184) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 02/04/2011, 21:43 
Banned

Iscritto il: 31/10/2010
Messaggi: 1363
Località: Sicilia
Favourite GTA: San Andreas
Xfire: peppinux

Karma
-10


Non connesso
Posta le righe 3181 e 3184.


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 02/04/2011, 22:29 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
Codice:
other[1] = SetPlayerVirtualWorld(strval(tmp));


Codice:
GetPlayerVirtualWorld(playerid, other[1]);

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 03/04/2011, 22:14 
Avatar utente
Utente

Iscritto il: 31/10/2010
Messaggi: 901
Località: Universo - Via Lattea - Sistema Solare - Pianeta Terra - Europa - Italia - Sicilia - Grammichele(CT)
Favourite GTA: San Andreas
Xfire: Privato

Karma
2


Non connesso
cambia il primo con questo:

other[1] = GetPlayerVirtualWorld(strval(tmp));

e il secondo con

SetPlayerVirtualWorld(playerid, other[1]);

_________________
Immagine


I Miei Filterscript Per Sa-Mp

Rampone System By me and Mik_Teck
Autovelox System By me and Mik_Teck
Metro System By me
pLaserPointer By me

Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 04/04/2011, 21:41 
Avatar utente
Utente

Iscritto il: 04/02/2011
Messaggi: 268
Località: Milano
Favourite GTA: GTA IV
Xfire: themay91

Karma
0


Non connesso
ora funziona ma... appena faccio goto mi gota da un player qualsiasi senza che io metta l'ID..

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]goto
MessaggioInviato: 04/04/2011, 21:47 
Avatar utente
Utente

Iscritto il: 22/12/2010
Messaggi: 1098
Località: Agrigento (Sicilia)
Favourite GTA: San Andreas
Xfire: In PM

Karma
0


Non connesso
Sotto:

Codice:
tmp = strtok(cmdtext, idx);

Inserisci:

Codice:
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USO: /goto <id>");

_________________
Immagine


Top
 E-mail  
 
Visualizza ultimi messaggi:  Ordina per  
 Pagina 1 di 2 [ 22 messaggi ] 

Vai alla pagina :: 1, 2  Prossima »
  Apri un nuovo argomento Questo argomento è bloccato, non puoi modificare o inviare ulteriori messaggi.

Tutti gli orari sono UTC + 1 ora [ ora legale ]



Chi c’è in linea

Visitano il forum: Nessuno e 180 ospiti


Non puoi aprire nuovi argomenti
Non puoi rispondere negli argomenti
Non puoi modificare i tuoi messaggi
Non puoi cancellare i tuoi messaggi
Non puoi inviare allegati

Cerca per:
Vai a: