CreateNitroPickup
#1

Hello everyone i wanted to make my own nitro pickup and it work without errors.
but when i enter the pickup nothing happen, i don't get nitro.
Here is the code :
pawn Код:
stock CreateNitro(Float:x,Float:y,Float:z,VirtualWorld)
    {
    Create3DTextLabel("[Nitro]",0xAA3333AA,x,y,z,20,VirtualWorld);
    for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the admins
    {
    if(IsPlayerInRangeOfPoint(i,5,x,y,z))
    {
    if(IsPlayerInAnyVehicle(i))
    {
    SendClientMessage(i,0xAA3333AA,"Youa are in");
    AddVehicleComponent(GetPlayerVehicleID(i),1010);
    }
    }
    }
    }
Reply
#2

Help D: ?
Reply
#3

I think u need to add if(IsPlayerConnected) because of the MAX_PLAYERS loop,and u are not looping through admins,that loop is for all players
Reply
#4

try with this
Код:
if(IsPlayerInAnyVehicle(i))
{ 
   new vehicle;
   vehicle = GetPlayerVehicleID(i);

   SendClientMessage(i,0xAA3333AA,"Youa are in");   
   AddVehicleComponent(vehicle,1010);
}
edit : how actually are you calling this func
Reply
#5

Quote:
Originally Posted by detter
Посмотреть сообщение
try with this
Код:
if(IsPlayerInAnyVehicle(i))
{ 
   new vehicle;
   vehicle = GetPlayerVehicleID(i);

   SendClientMessage(i,0xAA3333AA,"Youa are in");   
   AddVehicleComponent(vehicle,1010);
}
edit : how actually are you calling this func
hopeless you didn't change any thing in the code , it's just like you changed the code appearance nothing else and actually and I don't want to decreed, but it's kinda function(stocks are different kind of functions that not in need"forwards" and in the same time it can't be called in some re-calls like "Timers")

Try this:

pawn Код:
stock CreateNitro(Float:x,Float:y,Float:z,VirtualWorld)
{
    Create3DTextLabel("[Nitro]",0xAA3333AA,x,y,z,20,VirtualWorld);
    for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the admins
    {
        if(PInfo[i][pAdmin] >= 1 &&IsPlayerInRangeOfPoint(i,5,x,y,z)) // edit this line to your basics
        {
            if(IsPlayerInAnyVehicle(i))
            {
                SendClientMessage(i,0xAA3333AA,"Youa are in");
                AddVehicleComponent(GetPlayerVehicleID(i),1010);
            }
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Youice
Посмотреть сообщение
hopeless you didn't change any thing in the code , it's just like you changed the code appearance nothing else and actually and I don't want to decreed, but it's kinda function(stocks are different kind of functions that not in need"forwards" and in the same time it can't be called in some re-calls like "Timers")

Try this:

pawn Код:
stock CreateNitro(Float:x,Float:y,Float:z,VirtualWorld)
{
    Create3DTextLabel("[Nitro]",0xAA3333AA,x,y,z,20,VirtualWorld);
    for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the admins
    {
        if(PInfo[i][pAdmin] >= 1 &&IsPlayerInRangeOfPoint(i,5,x,y,z)) // edit this line to your basics
        {
            if(IsPlayerInAnyVehicle(i))
            {
                SendClientMessage(i,0xAA3333AA,"Youa are in");
                AddVehicleComponent(GetPlayerVehicleID(i),1010);
            }
        }
    }
    return 1;
}
You did just the same thing ,put on the different cloth
and stock will not be executed if they are not called ,so it matters
Reply
#7

Quote:
Originally Posted by detter
Посмотреть сообщение
You did just the same thing ,put on the different cloth
and stock will not be executed if they are not called ,so it matters
well nope, I didn't do the same thing, and why would you add it, although you are not using it?, so it will must be called otherwise he can just put /* */ or removes the code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)