Oggi è 16/05/2024, 8:59

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 1 [ 12 messaggi ] 

  Apri un nuovo argomento Questo argomento è bloccato, non puoi modificare o inviare ulteriori messaggi.

  Stampa pagina

Autore Messaggio
 Oggetto del messaggio: [RISOLTO][REQ]V, nome, costo.
MessaggioInviato: 02/06/2011, 19:19 
Avatar utente
Utente

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

Karma
0


Non connesso
mi sevirebbe un carspawner con comando /v nomeauto,
con le seguenti funzioni quando viene spawnato un veicolo ne richiede il nome, costo (es: 300$). quindi se viene spawnato che compaia un: hai spawnato il veicolo... costo: 300$.
e che ad ogni veicolo che si spawna venga tolto quel altro, e che bisogna aspettare 3 min prima di spawnarne un altro. infine se il giocatore e dentro al veicolo non glielo fa spawnare facendo comparire il messaggio che ha gia un veicolo. spero di essermi spiegato bene :ghfuma:

ps: avevo provato con uno simile, ma non aveva la funzione di togliere il veicolo quando ne spawni un altro.

_________________
Immagine


Top
 E-mail  
 

 Oggetto del messaggio: Re: [REQ]V, nome, costo.
MessaggioInviato: 02/06/2011, 20:40 
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
In Cima: http://pastebin.com/8tcYcxuZ

In OnPlayerCommandText: http://pastebin.com/ecUQPLNd

In OnPlayerEnterVehicle:
Codice:
if(inauto[playerid]  && automobile[playerid] != vehicleid) inauto[playerid] = false;


In OnVehicleDeath:
Codice:
public OnVehicleDeath(vehicleid, killerid)
{
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
       if(automobile[i] == vehicleid)
       {
          DestroyVehicle(vehicleid);
       }
   }
   return 1;
}


In OnPlayerStateChange:

Codice:
if(newstate == PLAYER_STATE_ONFOOT && inauto[playerid] == true)
{
    vectimer[playerid] = SetTimerEx("Distruggi", 5000, false, "d", playerid);
}

if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == automobile[playerid])
{
    KillTimer(vectimer[playerid]);
    inauto[playerid] = true;
}


Fuori da tutto:
Codice:
GetVehicleModelFromName(vname[])
{
   for(new i = 0; i < 211; i++)
   {
      if (strfind(VehicleNames[i], vname, true) != -1 )
      return i + 400;
   }
   return -1;
}

forward Distruggi(playerid);
public Distruggi(playerid)
{
    DestroyVehicle(automobile[playerid]);
    inauto[playerid] = false;
}

forward Anticmd(playerid);
public Anticmd(playerid)
{
    Impedisci[playerid] = false;
    SendClientMessage(playerid, COLOR_RED, "Ora puoi respawnare un veicolo");
}



Prova questo, fatto al volo :\

_________________
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]V, nome, costo.
MessaggioInviato: 02/06/2011, 21:36 
Avatar utente
Utente

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

Karma
0


Non connesso
scrivio /v, compare utilizzo: /v [nome o id] ed e ok, scrivo /v Taxi (Es) e mi da Server Unknown command


provo a controllare di averlo messo giusto.

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]V, nome, costo.
MessaggioInviato: 05/06/2011, 12:59 
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 errori:

Codice:
C:\Users\Pavilion\Desktop\Test Server\pawno\ILV5.0.4.pwn(818) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Users\Pavilion\Desktop\Test Server\pawno\ILV5.0.4.pwn(822) : error 006: must be assigned to an array
C:\Users\Pavilion\Desktop\Test Server\pawno\ILV5.0.4.pwn(823) : error 006: must be assigned to an array
C:\Users\Pavilion\Desktop\Test Server\pawno\ILV5.0.4.pwn(824) : error 006: must be assigned to an array
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.


righe

Codice:
822. tmp[0] = strtok(cmdtext,idx);
823. tmp[1] = strtok(cmdtext,idx);
824. tmp[2] = strtok(cmdtext,idx);


"idx" e gia definito.

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]V, nome, costo.
MessaggioInviato: 06/06/2011, 14:19 
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
EDIT:

Cambia tutti il comando /v con questo:

http://pastebin.com/RKrXLzCJ

La sintassi del comando è:

/v [Nome Veicolo o ID Veicolo] [Colore1] [Colore2]

Se ometti il colore verrà impostato -1 -1

se ti manca il strrest eccolo qua:

Codice:
stock strrest(const string[], &index)
{
   new length = strlen(string);
   while ((index < length) && (string[index] <= ' '))
   {
      index++;
   }
   new offset = index;
   new result[128];
   while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
   {
      result[index - offset] = string[index];
      index++;
   }
   result[index - offset] = EOS;
   return result;
}


L'ho appena testato quindi dovrebbe funzionare anche a te, 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]V, nome, costo.
MessaggioInviato: 10/06/2011, 11:42 
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 5.0.7\pawno\ILVGM.pwn(247) : error 017: undefined symbol "cmd"
C:\Users\Pavilion\Desktop\SERVER ILV 5.0.7\pawno\ILVGM.pwn(256) : error 017: undefined symbol "strtok"
C:\Users\Pavilion\Desktop\SERVER ILV 5.0.7\pawno\ILVGM.pwn(256) : error 033: array must be indexed (variable "tmp")
C:\Users\Pavilion\Desktop\SERVER ILV 5.0.7\pawno\ILVGM.pwn(257) : error 017: undefined symbol "strtok"
C:\Users\Pavilion\Desktop\SERVER ILV 5.0.7\pawno\ILVGM.pwn(257) : error 033: array must be indexed (variable "tmp")
C:\Users\Pavilion\Desktop\SERVER ILV 5.0.7\pawno\ILVGM.pwn(258) : error 017: undefined symbol "strtok"
C:\Users\Pavilion\Desktop\SERVER ILV 5.0.7\pawno\ILVGM.pwn(258) : error 033: array must be indexed (variable "tmp")
C:\Users\Pavilion\Desktop\SERVER ILV 5.0.7\pawno\ILVGM.pwn(306) : error 010: invalid function or declaration
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.



RIGA 247. if(strcmp(cmd, "/v", true)==0)
RIGA 256. tmp[0] = strtok(cmdtext,idx);
RIGA 257. tmp[1] = strtok(cmdtext,idx);
RIGA 258. tmp[2] = strtok(cmdtext,idx);
RIGA 306. if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == automobile[playerid])

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]V, nome, costo.
MessaggioInviato: 10/06/2011, 12:53 
Avatar utente
Utente

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

Karma
0


Non connesso
Ma lo hai strtok definito?

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]V, nome, costo.
MessaggioInviato: 10/06/2011, 12:54 
Avatar utente
Utente

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

Karma
0


Non connesso
si..

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]V, nome, costo.
MessaggioInviato: 10/06/2011, 12:57 
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
Metti sopra alla riga del comando:

new cmd[256];
cmd = strtok(cmdtext, idx);

e Sotto a tutto:
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]V, nome, costo.
MessaggioInviato: 10/06/2011, 13:21 
Avatar utente
Utente

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

Karma
0


Non connesso
C:\Users\Pavilion\Desktop\SERVER ILV 5.0.7\pawno\ILVGM.pwn(278) : error 017: undefined symbol "idx"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


- lo definito ma mi da questo errore

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [REQ]V, nome, costo.
MessaggioInviato: 10/06/2011, 13:51 
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
metti new idx; sopra new cmd[256];

_________________
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]V, nome, costo.
MessaggioInviato: 10/06/2011, 14:58 
Avatar utente
Utente

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

Karma
0


Non connesso
Risolto, :lock:

_________________
Immagine


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

  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 7 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:  
cron