[AJUDA] CARROS
#1

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;
    }
Reply
#2

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..
Reply
#3

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;
    }
Reply
#4

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

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);
    }
Reply
#6

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

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?
Reply
#8

Assim fica dificil.
Reply
#9

Claro, cafй?
Reply
#10

seria bom umas rosquinhas tbm..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)