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


Messages In This Thread
Neon command not working? - by Nathan_Taylor - 11.03.2013, 00:39
Re: Neon command not working? - by Nathan_Taylor - 11.03.2013, 13:43
Re: Neon command not working? - by Scrillex - 11.03.2013, 13:53
Re: Neon command not working? - by Nathan_Taylor - 11.03.2013, 14:36
Re: Neon command not working? - by Scrillex - 11.03.2013, 14:38
Re: Neon command not working? - by Nathan_Taylor - 11.03.2013, 14:41

Forum Jump:


Users browsing this thread: 1 Guest(s)