Neon command not working?
#1

This is my command
pawn Код:
CMD:neon(playerid, params[])
    {
     if(pInfo[playerid][Admin] > 1){
     
        if(IsPlayerInAnyVehicle(playerid)){
       
            new
                color[128],
                carid;
       
            if(!sscanf(params, "s[128]", color)){
           
               
                if(!strcmp(color, "white", true, 10)){
                    //new neon = CreateObject(18652,0,0,0,0,0,0);
                    //new neon2 = CreateObject(18652,0,0,0,0,0,0);
                    SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0));
                    SetPVarInt(playerid, "neon2", CreateObject(18648,0,0,0,0,0,0));
                }
                if(!strcmp(color, "blue", true, 10)){
                    SetPVarInt(playerid, "neon", CreateObject(8648,0,0,0,0,0,0));
                    SetPVarInt(playerid, "neon2", CreateObject(18648,0,0,0,0,0,0));
                }
                if(!strcmp(color, "green", true, 10)){
                    SetPVarInt(playerid, "neon", CreateObject(18649,0,0,0,0,0,0));
                    SetPVarInt(playerid, "neon2", CreateObject(18649,0,0,0,0,0,0));
                }
                if(!strcmp(color, "yellow", true, 10)){
                    SetPVarInt(playerid, "neon", CreateObject(18650,0,0,0,0,0,0));
                    SetPVarInt(playerid, "neon2", CreateObject(18650,0,0,0,0,0,0));
                }
                if(!strcmp(color, "pink", true, 10)){
                    SetPVarInt(playerid, "neon", CreateObject(18651,0,0,0,0,0,0));
                    SetPVarInt(playerid, "neon2", CreateObject(18651,0,0,0,0,0,0));
                }
               
                carid = GetPlayerVehicleID(playerid);
               
                new neon1 = AttachObjectToVehicle(GetPVarInt(playerid, "neon"), carid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                new neon2 = AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), carid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
           
            } else {
                SendClientMessage(playerid, -1, "USAGE: /neon [color]");
                SendClientMessage(playerid, -1, "Colors: white, blue, green, yellow, pink");
            }
       
        } else {
            SendClientMessage(playerid, COLOR_LIGHTPINK, "Your must be in a car to use neon");
        }
     
     } else {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "You don't have access to this command");
     }
     return 1;
    }
Before you tell me, I knw it isn't deleting the old ones if there are any, cause I can't figure out how to do that. However, it isn't even spawning the object. Anyone know why? Please don't just paste a new code that will work, please tell me what I did wrong and why it is wrong. Posting a new code that just works doesn't help me become a better coder. Thanks in advance.
Reply
#2

bumpp
Reply
#3

CreateObject(18649,0,0,0,0,0,0));

0,0,0,0,0, I think is the case!

You need to make it in float x y z and make them moveable because 0,0,0,0, is under the ground near SF!
Reply
#4

Correct me if I'm wrong, but isn't the "AttachObjectToVehicle" moving the object to right near the vehicle?
Reply
#5

Here you go tutorial how to do it! (thats lin)
Reply
#6

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)