GTA-Center.com » Forum
http://www.gta-center.com/forums/

[HELP]Mi Servono 3 Script
http://www.gta-center.com/forums/viewtopic.php?f=41&t=1283
Pagina 1 di 2

Autore:  GianlucA_Ct [ 02/07/2011, 19:54 ]
Oggetto del messaggio:  [HELP]Mi Servono 3 Script

Allora ciao a tutti raga mi servirebbero 3 script:
1° Mi servirebbe uno script che blocca l'id dell'hydra cioè che lo blocca a chi non e del clan [IFS]
2°Sistema AFK che rileva quando sei in pausa e cambia il tuo nome es: player non afk [IFS]GianlucA_Ct,player AFK [AFK][IFS]GianlucA_Ct
3° ed ultima richiesta XD mi serve un super freno (come il /flip) che si attivasse se premo due volte rapidamente il tasto del freno

Autore:  Angelo [ 02/07/2011, 21:00 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

1.
In OnPlayerStateChange

Codice:
new Veh = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && Veh == 520)
{
    new pName[24];
    GetPlayerName(playerid, pName, 24);
    if(strfind(pName, "[IFS]", true) == -1)
    {
        RemovePlayerFromVehicle(playerid);
        SetVehicleParamsForPlayer(Veh, playerid, 0, 1);
    }
    else SetVehicleParamsForPlayer(Veh, playerid, 0, 0);
}


2.
In Cima:
Codice:
new Float: pPos[MAX_PLAYERS][3];
new bool:AFK[playerid];
new label[MAX_PLAYERS];
new bool:Attaccata[MAX_PLAYERS];


In OnPlayerConnect
Codice:
GetPlayerPos(playerid, pPos[playerid][0], pPos[playerid][1], pPos[playerid][2]);
SetTimerEx("ControllaAFK", 5000, true, "i", playerid);


Fuori da tutto
Codice:
forward ControllaAFK(playerid);
public ControllaAFK(playerid)
{
    new Float:pPos2[3];
    GetPlayerPos(playerid, pPos2[0], pPos2[1], pPos2[2]);
    if(pPos[playerid][0] == pPos2[0] && pPos[playerid][1] == pPos2[1] && pPos[playerid][2] == pPos2[2])
    {
        AFK[playerid] = true;
        SetPlayerHealth(playerid, 100000.0);
    }
    else
    {
        if(AFK[playerid] )
        {
            AFK[playerid] = false;
            SetPlayerHealth(playerid, 100.0);
        }
        GetPlayerPos(playerid, pPos[playerid][0], pPos[playerid][1], pPos[playerid][2]);
    }
    return 1;
}


In OnPlayerUpdate
Codice:
if(AFK[playerid] && !Attaccata[playerid]) 
{
    label[playerid] = Create3DTextLabel("In Afk", COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
    Attaccata[playerid] = true;
}
else if(!AFK[playerid] && Attaccata[playerid])
{
    Delete3DTextLabel(label[playerid]);
    Attaccato[playerid] = false;
}


3.
In Cima
Codice:
new SuperFreno[MAX_PLAYERS];
FrenoTimer[MAX_PLAYERS];


In OnPlayerKeyStateChange
Codice:
if(newkeys & KEY_DOWN && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    if(SuperFreno[playerid] == 2)
    {
        SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.0);
        SuperFreno[playerid] = 0;
        return 1;
    }
    SuperFreno[playerid] ++;
    if(SuperFreno[playerid] == 1) SetTimerEx("ControllaVar", 2000, false, "i", playerid);
}


Fuori da tutto
Codice:
forward ControllaVar(playerid);
public ControllaVar(playerid)
{
    if(SuperFreno[playerid] == 1) SuperFreno[playerid] = 0;
    return 1;
}


Prova questi tre asd

Autore:  GianlucA_Ct [ 03/07/2011, 0:50 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Allora quello dell' hydra non funziona,il super freno non funziona bene cioè se premo 2 volte tasto DOWN (tasto freno lol) non va ma se premo due volte il freno a mano va pero forse ce vuole un timer tipo che se lo premo in un mezzo secondo due volte funziona,il sistema AFK da errori ecco qui:

C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(13) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(13) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4039) : warning 213: tag mismatch
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4040) : warning 213: tag mismatch
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4045) : warning 213: tag mismatch
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4046) : error 017: undefined symbol "Attaccato"
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4046) : warning 215: expression has no effect
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4046) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4046) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4046) : fatal error 107: too many error messages on one line

asd

Autore:  Francesco_Ronaldo [ 03/07/2011, 10:19 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

1.
In cima:
Codice:
new hidraprivato;


OnGamemodeInit:
Codice:
hidraprivato = AddStaticVehicle(id, coordinate e colori del tuo hidra);


OnPlayerStateChange:
Codice:
if(newstate == PLAYER_STATE_DRIVER)
{
    if(GetPlayerVehicleID(playerid) == hidraprivato)
    {
        new nome[24];
        GetPlayerName(playerid, nome, 24);
        if(strfind(nome, [IFS], true) != -1)
        {
           SendClientMessage(playerid, -1, "Benvenuto nel tuo veicolo, membro del clan.");
        }
        else RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, -1, "Non sei del clan [IFS].");
    }
}


Sostituisci -1 con il colore che vuoi.


2.
Angelo ha sbagliato qualcosa in questa riga:
Codice:
if(AFK[playerid] )

Prova a cambiarla con questa:
Codice:
if(AFK[playerid] == true)


3. Non ti so aiutare.

Autore:  GianlucA_Ct [ 03/07/2011, 12:43 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Allora per quanto riguarda i veicoli li forse ci arrivavo anch'io xD ma cosi dovro fare 100 script cosi per bloccare tutti gli hunter hydra in più le coordinate .-. un po troppo complicato ma grazie lo stesso :D

Per il sistema Afk:
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(9) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(9) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4026) : warning 213: tag mismatch
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4027) : warning 213: tag mismatch
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4032) : warning 213: tag mismatch
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4033) : error 017: undefined symbol "Attaccato"
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4033) : warning 215: expression has no effect
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4033) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4033) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gianluca\Desktop\[IF]Server Italian Force\gamemodes\Italian_Force.pwn(4033) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.

Autore:  Francesco_Ronaldo [ 03/07/2011, 14:53 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

GianlucA_Ct ha scritto:
Allora per quanto riguarda i veicoli li forse ci arrivavo anch'io xD

Ma mi prendi per un novellino per caso? :facepalm:
Il mio metodo va bene perchè se ad esempio nel tuo server c'è un car spawner e una persona spawna un hidra, non gli impedirà di entrare. Col metodo di Angelo si.
Per aggiungere altri veicoli, basta che crei altre variabili e nello script fai così:
Codice:
if(GetPlayerVehicleID(playerid) == hidraprivato || GetPlayerVehicleID(playerid) == hidraprivato2)

Comunque una curiosità: perchè se ci arrivavi da solo non ti sei fatto lo script? Quello postato da Angelo è semplicissimo da fare così come il mio. Oppure crea un metodo diverso da questi che sono proprio curioso di vedere cosa fai.

3. Incollami le righe dove ci sono errori.

Autore:  GianlucA_Ct [ 03/07/2011, 15:05 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Scusa ma il carspawn gia c'è l'ho e ho privato i veicoli solo agli IFS pero io dico il fs che mi hai dato tu devi mettere le coordinate dei veicoli,in tutto nel server ci sono una 40ina di hydra
E poi non o detto che sei un novellino cmq se non ti va di aiutarmi lascia perdere io o postato qui per un aiuto poi chi mi risponde mi risponde

Autore:  Francesco_Ronaldo [ 03/07/2011, 19:20 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Non ci credo.. In OnGamemodeInit si creano i veicoli e tu devi aggiungere affianco alle righe dei veicoli hidraprivato =, hidraprivato2 = eccetera. Non devi creare nessun altro veicolo :facepalm:

Autore:  GianlucA_Ct [ 03/07/2011, 20:07 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

ASD allora in OnGameModeInit o
AddStaticVehicleEx(Id,coordinate);
Come o capito io nel tuo script devo mettere anche le coordinate ma invece a me serve lo script che blocca solo l'id del hydra e se entra lo fa uscire e dice "Devi essere un membro Italian Force per usare questo veicolo" perche con le coordinate non finisco piu :S

Autore:  Angelo [ 03/07/2011, 22:42 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

1. Sono un noob lol, ho controllato l'id del veicolo non il modello asd, cambia con questo:

Codice:
new Veh = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && GetVehicleModel(Veh) == 520)
{
    new pName[24];
    GetPlayerName(playerid, pName, 24);
    if(strfind(pName, "[IFS]", true) == -1)
    {
        RemovePlayerFromVehicle(playerid);
        SetVehicleParamsForPlayer(Veh, playerid, 0, 1);
    }
    else SetVehicleParamsForPlayer(Veh, playerid, 0, 0);
}


2.

Prima di tutto vorrei spiegare a francesco, tanto per informarlo, che fare if(AFK[playerid] ) o fare if(AFK[playerid] == true) è la stessa cosa asd

Per quanto riguarda lo script esegui i seguenti cambiamenti:

a. Cambia new bool:AFK[playerid]; con new bool:AFK[MAX_PLAYERS];
b. Cambia new label[MAX_PLAYERS]; con new Text3D:label[MAX_PLAYERS];
c. Nell'onplayerupdate cambia:

Codice:
else if(!AFK[playerid] && Attaccata[playerid])
{
    Delete3DTextLabel(label[playerid]);
    Attaccata[playerid] = false;
}


con
Codice:
else if(!AFK[playerid] && Attaccata[playerid])
{
    Delete3DTextLabel(label[playerid]);
    Attaccata[playerid] = false;
}


3. Prova a cambiare KEY_DOWN con KEY_ANALOG_DOWN

Autore:  GianlucA_Ct [ 03/07/2011, 23:23 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Allora lo script dei veicoli funziona ma bugga perchè se salgo dentro l'hydra il player fa sempre sali e scendi sali e scendi asd.
La KEY_ANALOG_DOWN non funziona.
Il sistema afk da ancora errori:
C:\Documents and Settings\Gianluca\Desktop\[IFS]Server Italian Force\gamemodes\Italian_Force.pwn(4036) : warning 225: unreachable code
C:\Documents and Settings\Gianluca\Desktop\[IFS]Server Italian Force\gamemodes\Italian_Force.pwn(4036) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gianluca\Desktop\[IFS]Server Italian Force\gamemodes\Italian_Force.pwn(4036) : error 017: undefined symbol "ControllaAFK"
C:\Documents and Settings\Gianluca\Desktop\[IFS]Server Italian Force\gamemodes\Italian_Force.pwn(4037) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Gianluca\Desktop\[IFS]Server Italian Force\gamemodes\Italian_Force.pwn(4037) : error 017: undefined symbol "ControllaAFK"
C:\Documents and Settings\Gianluca\Desktop\[IFS]Server Italian Force\gamemodes\Italian_Force.pwn(4059) : error 030: compound statement not closed at the end of file (started at line 4024)
Ps. ma in un server "Italian Fighters" c'era il sistema AFK che appena premevi esc lui ti metteva subito AFK,non si puo fare cosi? :D

Autore:  Angelo [ 04/07/2011, 0:05 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

1.

prova a togliere:
Codice:
else SetVehicleParamsForPlayer(Veh, playerid, 0, 0);


2. Dimmi che tasti usi per accelerare e frenare

3. Strano a me non ne dava O.o Posta l'intero script su pastebin

Autore:  GianlucA_Ct [ 04/07/2011, 0:13 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Io per accelerare la freccetta Su mentre per frenare la freccetta giu

Autore:  Angelo [ 04/07/2011, 0:16 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

prova a cambiare KEY_ANALOG_DOWN con 128

Autore:  GianlucA_Ct [ 04/07/2011, 0:23 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Già fatto .-. cmq ecco il codice pastebin http://pastebin.com/JEMdHF3b
Ps. come avevo detto prima non si puo fare quel sistema AFK come Italian Fighters?

EDIT:Se tolgo else SetVehicleParamsForPlayer(Veh, playerid, 0, 0); fa la stessa cosa .-.

Autore:  Angelo [ 04/07/2011, 1:02 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Cerca di non fare doppi messaggi nell'arco delle 24 h

cmq tornando allo script, ecco qua il sistema AFK: http://pastebin.com/sJPGBEVv

Comunque ho appena testato lo script dell'hydra e a me funziona benissimo ._. cioè se entri e non sei IFS ti butta fuori e non puoi più entrare nell'hydra, a me non fa nessun sali e scendi ._.

Per il fatto del super freno metti KEY_JUMP asd

Autore:  GianlucA_Ct [ 04/07/2011, 1:12 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Si scusa non faro piu messaggi nell arco delle 24H,a me invece fa sali e scendi :( azz , il super freno non si puo fare se premo due volte velocemente il tasto KEY_JUMP? perche se lo premo accelero lo ripremo accelero ancora e lo ripremo mi flippa il veicolo ASD,per il sistema afk da un warning... ma il player deve stare fermo 5 min giusto? e poi un altra cosa xD perche in OnPlayerConnect c'è questo? :
if(strfind(AfkName, "[IFS]", true) != -1) cosa centra ASd

Autore:  Angelo [ 04/07/2011, 1:24 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

1. Strano che ti faccia sali e scendi :\ posta lo script.

2. Cambia if(SuperFreno[playerid] == 1) SetTimerEx("ControllaVar", 2000, false, "i", playerid);

con

Codice:
if(SuperFreno[playerid] == 1)
{
    if(newkeys & KEY_SRPINT) return SuperFreno[playerid] = 0;
    SetTimerEx("ControllaVar", 2000, false, "i", playerid);
}


3. Posta il warning, quella riga l'ho aggiunta perchè ho capito male asd
comunque non si può gettare se un player preme ESC, perchè non si può gettare quale tasto preme precisamente il player :\ quindi ho fatto un timer che se vede che il player sta fermo per 5 secondi allora lo mette AFK, se dopo 5 secondi vede che si è mosso allora tolgo il AFK

Autore:  GianlucA_Ct [ 04/07/2011, 1:36 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

Allora il super freno non va
Ecco lo script
http://pastebin.com/QnmTgxSR
Per il sistema AFK warning risolto avevi sbagliato questo:
return 1;
}
}
e dovevi mettere questo
}
return 1;
}

E poi quel sistema afk se premi esc c'è in un server che ora ha chiuso..

Autore:  Angelo [ 04/07/2011, 1:45 ]
Oggetto del messaggio:  Re: [HELP]Mi Servono 3 Script

ma non hai tolto: else SetVehicleParamsForPlayer(Veh, playerid, 0, 0); ._. prova a toglierlo

Comunque il superfreno non funziona più ? in che senso non funziona o.o

E' impossibile gettare il tasto premuto dal player, è inutile che insisti, ti avranno detto una cazzata
comunque ti funziona questo sistema AFK ?

Pagina 1 di 2 Tutti gli orari sono UTC + 1 ora [ ora legale ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/