SA-MP Forums Archive
Neon help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Neon help (/showthread.php?tid=598870)



Neon help - Hellman92 - 17.01.2016

When i buy the neon i cant put it on its tells me this, hope someone can help me out thanks in advance!
Код:
		    if(GetPVarInt(playerid, "Neon") == 0) return SendClientMessage(playerid,COLOR_GREY,"You need neon to use this.");
PHP код:
        }
        else if(
strcmp(type"getneon"true) == 0)
        {
            new 
carid PlayerToCar(playerid,2,4.0);
            if(
VehicleInfo[carid][vOwned] == SCRIPT_CARS) return SendClientMessage(playerid,COLOR_GREY,"This is not an ownable vehicle.");
            if(
IsNotAEngineCar(carid)) return SendClientMessage(playeridCOLOR_GREY"This vehicle dosent have an engine.");
            if(
IsHelmetCar(carid)) return SendClientMessage(playeridCOLOR_GREY"This vehicle dosent have a door.");
            new 
key VehicleInfo[carid][vOwned];
            
CarInfo[key][cNeon]=1;
                
SetPVarInt(playerid"neon"CreateObject(18647,0,0,0,0,0,0));
              
SetPVarInt(playerid"neon"CreateObject(18647,0,0,0,0,0,0));
               
AttachObjectToVehicle(GetPVarInt(playerid"neon"), GetPlayerVehicleID(playerid), -0.80.0, -0.700.00.00.0);
            
AttachObjectToVehicle(GetPVarInt(playerid"neon"), GetPlayerVehicleID(playerid), 0.80.0, -0.700.00.00.0);
            
SendClientMessage(playerid0xFFFFFFAA"Neon installed");
            
SaveCars();
            
SaveCars2();
        }
        else if(
strcmp(type"takeonneon"true) == 0)
        {
            new 
carid PlayerToCar(playerid,2,4.0);
            new 
key VehicleInfo[carid][vOwned];
            if(
GetPVarInt(playerid"Neon") == 0) return SendClientMessage(playerid,COLOR_GREY,"You need neon to use this.");
            if(
CarInfo[key][cNeon] != 0) return SendClientMessage(playerid,COLOR_GREY,"This vehicle already contains neon.");
            if(
VehicleInfo[carid][vOwned] == SCRIPT_CARS) return SendClientMessage(playerid,COLOR_GREY,"This is not an ownable vehicle.");
            if(
IsNotAEngineCar(carid)) return SendClientMessage(playeridCOLOR_GREY"This vehicle dosent have an engine.");
            if(
IsHelmetCar(carid)) return SendClientMessage(playeridCOLOR_GREY"This vehicle dosent have a door.");
                
SetPVarInt(playerid"neon"CreateObject(18647,0,0,0,0,0,0));
              
SetPVarInt(playerid"neon"CreateObject(18647,0,0,0,0,0,0));
             
AttachObjectToVehicle(GetPVarInt(playerid"neon"), GetPlayerVehicleID(playerid), -0.80.0, -0.700.00.00.0);
            
AttachObjectToVehicle(GetPVarInt(playerid"neon"), GetPlayerVehicleID(playerid), 0.80.0, -0.700.00.00.0);
            
SendClientMessage(playerid0xFFFFFFAA"Neon attached to the vehicle");
        }
        else if(
strcmp(type"takeoffneon"true) == 0)
        {
            new 
carid PlayerToCar(playerid,2,4.0);
            new 
key VehicleInfo[carid][vOwned];
            if(
CarInfo[key][cNeon] > 1) return SendClientMessage(playeridCOLOR_GREY"You don't have installed neon on you'r vehicle!");
            if(
VehicleInfo[carid][vOwned] == SCRIPT_CARS) return SendClientMessage(playerid,COLOR_GREY,"This is not an ownable vehicle.");
            if(
IsNotAEngineCar(carid)) return SendClientMessage(playeridCOLOR_GREY"This vehicle dosent have an engine.");
            if(
IsHelmetCar(carid)) return SendClientMessage(playeridCOLOR_GREY"This vehicle dosent have a door.");
                
DeletePVar(playerid"neon"DestroyObject(18647));
              
DeletePVar(playerid"neon"DestroyObject(18647));
            
SendClientMessage(playerid0xFFFFFFAA"Neon deattached to the vehicle"); 



Re: Neon help - -CaRRoT - 17.01.2016

I believe that pVars are case sensitive, so your issue might be with capitalization.

Код:
 if(GetPVarInt(playerid, "Neon") == 0)
switch it to
Код:
 if(GetPVarInt(playerid, "neon") == 0)