SA-MP Forums Archive
[AJUDA] CARROS - 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] CARROS (/showthread.php?tid=282556)



[AJUDA] CARROS - Cristhian - 11.09.2011

quando o kra digita por exemplo /elegy, ele pode criar um monte de elegy, eu queria que tipo, se o kra ta com um /elegy quando ele digitasse /infernus por exemplo, o elegy fosse destruнdo e aparecesse um infernus pro kra..

PAWN:
pawn Код:
if (strcmp(cmdtext, "/elegy", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(562, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/nrg500", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(522, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/infernus", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(411, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/monster", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(444, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/turismo", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(451, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/bmx", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(481, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/supergt", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(506, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/bullet", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(541, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/sultan", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(560, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/flash", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(565, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/savanna", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(567, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/kart", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(571, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/wayfarer", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(586, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/club", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(589, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/cheetah", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(415, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/banshee", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(429, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/canddy", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(457, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/pcj600", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(461, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/faggio", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(462, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/linerunner", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(403, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/sanchez", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(468, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/quad", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(471, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/tropic", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(454, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/sabre", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(475, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/fcr900", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(521, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/vortex", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(539, X, Y, Z, 0.0, -1, -1, -1));
    }
    if (strcmp(cmdtext, "/bandito", true)==0)
    {
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(568, X, Y, Z, 0.0, -1, -1, -1));
    }
    if(strcmp(cmdtext, "/rc", true, 3) == 0)
    {
        new vehicleid;
        GetPlayerVehicleID(playerid);
        if(vehicleid == GetPVarInt(playerid, "Cris"))
        {
            DestroyVehicle(vehicleid);
            DeletePVar(playerid, "Cris");
        }
        return 1;
    }



Re: [AJUDA] CARROS - WLSF - 11.09.2011

bote um else dizendo que o cara jб tem um carro. e precisa sair deste primeiro para criar outro...
e ai adicione este 'PVar' em 'OnPlayerExitVehicle' ai quando ele sair destruirб o Veiculo..


Re: [AJUDA] CARROS - Allan Kardec - 11.09.2011

Estб a faltar return nestes seus comandos.

pawn Код:
new CarroCriado;
pawn Код:
if (strcmp(cmdtext, "/elegy", true)==0)
    {
        if(CarroCriado = 1)
        {
           new vehicleid = GetPlayerVehicleID(playerid);
           DestroyVehicle(vehicleid);
           return 1;
        }
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        SetPVarInt(playerid, "Cris", CreateVehicle(562, X, Y, Z, 0.0, -1, -1, -1));
        CarroCriado = 1;
        return 1;
    }



Re: [AJUDA] CARROS - Cristhian - 11.09.2011

deu um possivel nгo entendimento (warning 211: possibly unintended assignment) no CarroCriado = 1


Re: [AJUDA] CARROS - Ricop522 - 11.09.2011

pawn Код:
if (strcmp(cmdtext, "/elegy", true)==0)
    {
        new pvar = GetPVarInt(playerid, "Cris");
        if(pvar > 0)
        {
            DestroyVehicle(pvar);
        }
        new Float:X, Float:Y, Float:Z ;
        GetPlayerPos(playerid, X, Y, Z);
        new carro = CreateVehicle(562, X, Y, Z, 0.0, -1, -1, -1);
        SetPVarInt(playerid, "Cris", carro);
    }



Re: [AJUDA] CARROS - Cristhian - 11.09.2011

pode adicionar isso no comando inteiro ali em cima?
(/preguiзa)


Re: [AJUDA] CARROS - Vai_Besta - 11.09.2011

Quote:
Originally Posted by Cristhian
Посмотреть сообщение
pode adicionar isso no comando inteiro ali em cima?
(/preguiзa)
Mas o codigo й para vocк mesmo e vc esta com preguiзa?


Re: [AJUDA] CARROS - WLSF - 11.09.2011

Assim fica dificil.


Re: [AJUDA] CARROS - Ricop522 - 11.09.2011

Claro, cafй?


Re: [AJUDA] CARROS - Cristhian - 11.09.2011

seria bom umas rosquinhas tbm..