Oggi è 29/04/2024, 15:53

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

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

  Stampa pagina

Autore Messaggio
 Oggetto del messaggio: [RISOLTO][HELP]Convert YCMD..
MessaggioInviato: 13/09/2011, 18:26 
Avatar utente
Utente

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

Karma
0


Non connesso
Come posso convertire questo spawner usando YCMD + sscanf ?

--- RISOLTO ----

devo implementarlo nella GameMode.. e solo un esempio quello su pastebin..

_________________
Immagine


Ultima modifica di ~Bluec0de il 14/09/2011, 14:32, modificato 1 volta in totale.

Top
 E-mail  
 

 Oggetto del messaggio: Re: [HELP]Convert YCMD..
MessaggioInviato: 13/09/2011, 19:02 
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 comando con questo:

Codice:
YCMD:v(playerid, params[], help)
{
    #pragma unused help
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "[ERRORE]: Hai gia un veicolo. Esci dal veicolo per spawnarne un'altro");
    if(Impedisci[playerid]) return SendClientMessage(playerid, -1, "[ERRORE]: Devi aspettare 3 minuti prima di spawnare un altro veicolo");
    new
          vehname[64],
          veh,
          car,
          colore[2];
    if(sscanf(params, "s[64]ii", vehname, colore[0], colore[1]) return SendClientMessage(playerid, -1, "[ERRORE]: Utilizzo: /v <nome-auto> Colore1 Colore2");
    if(!isNumeric(vehname)) veh = GetVehicleModelFromName(strval(vehname)); else veh = strval(vehname);
    if(veh < 400 || veh > 611) return SendClientMessage(playerid, -1, "[ERRORE]: Inserisci un nome corretto per poter spawnare un veicolo.");
    new Float:Stats[4];
    GetPlayerPos(playerid, Stats[0], Stats[1], Stats[2]); GetPlayerFacingAngle(playerid, Stats[3]);
    if(inauto[playerid]==true)
    {
        DestroyVehicle(automobile[playerid]);
    }
    KillTimer(vectimer[playerid]);
    car = AddStaticVehicle(veh, Stats[0], Stats[1], Stats[2], Stats[3], colore[0], colore[1]);
    LinkVehicleToInterior(car, GetPlayerInterior(playerid));
    TogglePlayerControllable(playerid, true);
    SetVehicleVirtualWorld(veh, GetPlayerVirtualWorld(playerid));
    format(stringa, 128, "[VEICOLO]: hai spawnato: '%s' (Model ID:%d)", VehicleNames[veh-400], veh);
    SendClientMessage(playerid, -1, stringa);
    format(stringa, 128, "{00FF00}I{FFFFFF}L{FF0000}V %d", veh);
    SetVehicleNumberPlate(car, stringa);
    SetVehicleToRespawn(car);
    SetVehiclePos(car, Stats[0], Stats[1], Stats[2]);
    PutPlayerInVehicle(playerid, car, 0);
    automobile[playerid] = GetPlayerVehicleID(playerid);
    inauto[playerid] = true;
    SetTimerEx("Anticmd", 60000*3, false, "d", playerid);
    Impedisci[playerid] = true;
    return 1;
}


Logicamente se farai /v Infernus ti chiederà di inserire anche i colori

_________________
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: [HELP]Convert YCMD..
MessaggioInviato: 13/09/2011, 19:53 
Avatar utente
Utente

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

Karma
0


Non connesso
da i seguenti errori:

Codice:
error 001: expected token: ")", but found "return"
error 035: argument type mismatch (argument 1)


RIGHE:

Codice:
   /* 522 */ if(sscanf(params, "s[64]ii", vehname, colore[0], colore[1]) return SendClientMessage(playerid, -1, "[ERRORE]: Utilizzo: /v <nome-auto> Colore1 Colore2");
   /* 523 */ if(!isNumeric(vehname)) veh = GetVehicleModelFromName(strval(vehname)); else veh = strval(vehname);

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [HELP]Convert YCMD..
MessaggioInviato: 13/09/2011, 20:33 
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 con:

Codice:
if(sscanf(params, "s[64]ii", vehname, colore[0], colore[1])) return SendClientMessage(playerid, -1, "[ERRORE]: Utilizzo: /v <nome-auto> Colore1 Colore2");
if(!isNumeric(vehname)) veh = GetVehicleModelFromName(vehname); else veh = strval(vehname);

_________________
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: [HELP]Convert YCMD..
MessaggioInviato: 13/09/2011, 20:52 
Avatar utente
Utente

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

Karma
0


Non connesso
si puo fare anche in modo che non gli chiedesse i colori... ? pero che spawni veicoli colorati..

_________________
Immagine


Top
 E-mail  
 
 Oggetto del messaggio: Re: [HELP]Convert YCMD..
MessaggioInviato: 14/09/2011, 0:31 
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 cmd con questo:

Codice:
YCMD:v(playerid, params[], help)
{
    #pragma unused help
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "[ERRORE]: Hai gia un veicolo. Esci dal veicolo per spawnarne un'altro");
    if(Impedisci[playerid]) return SendClientMessage(playerid, -1, "[ERRORE]: Devi aspettare 3 minuti prima di spawnare un altro veicolo");
    new
          veh,
          car;
    if(isnull(params)) return SendClientMessage(playerid, -1, "[ERRORE]: Utilizzo: /v <nome-auto>");
    if(!isNumeric(params)) veh = GetVehicleModelFromName(params); else veh = strval(params);
    if(veh < 400 || veh > 611) return SendClientMessage(playerid, -1, "[ERRORE]: Inserisci un nome corretto per poter spawnare un veicolo.");
    new Float:Stats[4];
    GetPlayerPos(playerid, Stats[0], Stats[1], Stats[2]); GetPlayerFacingAngle(playerid, Stats[3]);
    if(inauto[playerid]==true)
    {
        DestroyVehicle(automobile[playerid]);
    }
    KillTimer(vectimer[playerid]);
    car = AddStaticVehicle(veh, Stats[0], Stats[1], Stats[2], Stats[3], -1, -1);
    LinkVehicleToInterior(car, GetPlayerInterior(playerid));
    TogglePlayerControllable(playerid, true);
    SetVehicleVirtualWorld(veh, GetPlayerVirtualWorld(playerid));
    format(stringa, 128, "[VEICOLO]: hai spawnato: '%s' (Model ID:%d)", VehicleNames[veh-400], veh);
    SendClientMessage(playerid, -1, stringa);
    format(stringa, 128, "{00FF00}I{FFFFFF}L{FF0000}V %d", veh);
    SetVehicleNumberPlate(car, stringa);
    SetVehicleToRespawn(car);
    SetVehiclePos(car, Stats[0], Stats[1], Stats[2]);
    PutPlayerInVehicle(playerid, car, 0);
    automobile[playerid] = GetPlayerVehicleID(playerid);
    inauto[playerid] = true;
    SetTimerEx("Anticmd", 60000*3, false, "d", playerid);
    Impedisci[playerid] = true;
    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: [HELP]Convert YCMD..
MessaggioInviato: 14/09/2011, 14:31 
Avatar utente
Utente

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

Karma
0


Non connesso
Grazie angelo. :lock:

_________________
Immagine


Top
 E-mail  
 
Visualizza ultimi messaggi:  Ordina per  
 Pagina 1 di 1 [ 7 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 183 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: