SA-MP Forums Archive
Not Create Vehicle. - 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: Not Create Vehicle. (/showthread.php?tid=319579)



Not Create Vehicle. - _DownLoaD_ - 19.02.2012

i have stunt Mission.
when the first player start the misson the code doesnt put him in the vehicle and after it destroy it.
but if i'm the second that make the mission, all works ok.
here is the code when player start the Mission:

PHP код:
if(dialogid == StuntMission_Dialog && response)
{
    if(!
CPS_IsPlayerInCheckpoint(playerid,RampCheck)) return SendClientMessage(playerid,COLOR_RED,".айрк бц'аифейри щм ощйоъ дсиари");
    if(
GetPlayerMoney(playerid)< 1000) return SendClientMessage(playerid,COLOR_RED,"! 1,000$ тмеъ дощйод темд");
    if(
StuntOn == 1) return SendClientMessage(playerid,COLOR_RED,".ойщде лбш тещд аъ дощйод");
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"! ца одшлб");
    
DestroyVehicle(RampNRG);
    
RemovePlayerFromVehicle(playerid);
    
RampNRG CreateVehicleEx(522,1968.2848,-1424.8018,13.1373,90.8023,1,0,50000,0,StuntMissionVirtualWorld);
    
SetPlayerVirtualWorld(playeridStuntMissionVirtualWorld);
    
PutPlayerInVehicle(playeridRampNRG0);
    
SetPlayerRaceCheckpoint(playerid,2,1826.9647,-1436.8265,35.9219,1826.9647,-1436.8265,35.9219,10);
    
InStunt[playerid] = 1;
    
StuntOn 1;
    
GivePlayerMoney(playerid,-1000);
    
format(stringsizeof(string), "[Stunt Mission ] >> .йца мощйоъ дсиари \"%s\""GetName(playerid));
    
SendClientMessageToAll(COLOR_PINKstring);
    
SendClientMessage(playerid,COLOR_AQUA,".дъзмъ аъ ощйоъ дсиари, йщ мк гчд мдвйт мвв");
    
SendClientMessage(playerid,COLOR_AQUA,".бойгт еъйфем / йтбеш джоп / ъщъвш ъфсм одощйод");
    for(new 
i=0;i<MAX_PLAYERS;i++)
{
    if(
IsPlayerConnected(i))
{
    if(
InStunt[i] == 1)
{
    
RampTimer[i] = SetTimerEx("CountDown"10001"i"i);
    
RampCD[i] = 60;
}}}} 
if you nee the public CountDown POST here.


Re: Not Create Vehicle. - _DownLoaD_ - 19.02.2012

Any help? if you will help me, I will Rep for you


Re: Not Create Vehicle. - aRoach - 19.02.2012

pawn Код:
if(dialogid == StuntMission_Dialog && response)
{
    if(!CPS_IsPlayerInCheckpoint(playerid,RampCheck)) return SendClientMessage(playerid,COLOR_RED,".айрк бц'аифейри щм ощйоъ дсиари");
    if(GetPlayerMoney(playerid)< 1000) return SendClientMessage(playerid,COLOR_RED,"! 1,000$ тмеъ дощйод темд");
    if(StuntOn == 1) return SendClientMessage(playerid,COLOR_RED,".ойщде лбш тещд аъ дощйод");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"! ца одшлб");
    DestroyVehicle(RampNRG);
    RampNRG = CreateVehicleEx(522,1968.2848,-1424.8018,13.1373,90.8023,1,0,50000,0,StuntMissionVirtualWorld);
    SetPlayerVirtualWorld(playerid, StuntMissionVirtualWorld);
    PutPlayerInVehicle(playerid, RampNRG, 0);
    SetPlayerRaceCheckpoint(playerid,2,1826.9647,-1436.8265,35.9219,1826.9647,-1436.8265,35.9219,10);
    InStunt[playerid] = 1;
    StuntOn = 1;
    GivePlayerMoney(playerid,-1000);
    format(string, sizeof(string), "[Stunt Mission ] >> .йца мощйоъ дсиари \"%s\"", GetName(playerid));
    SendClientMessageToAll(COLOR_PINK, string);
    SendClientMessage(playerid,COLOR_AQUA,".дъзмъ аъ ощйоъ дсиари, йщ мк гчд мдвйт мвв");
    SendClientMessage(playerid,COLOR_AQUA,".бойгт еъйфем / йтбеш джоп / ъщъвш ъфсм одощйод");
    for(new slots = GetMaxPlayers( ), i; i < SLOTS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(InStunt[i] == 1)
            {
                RampTimer[i] = SetTimerEx("CountDown", 1000, 1, "i", i);
                RampCD[i] = 60;
            }
        }
    }
    return 1;
}



Re: Not Create Vehicle. - _DownLoaD_ - 19.02.2012

Still same problem, its also take like 5 seconds until he create the car. here is the stock:
stock CreateVehicleEx(modelid,Float,Float:y,Float:z,Fl oat:a,color1,color2,respawn_delay,interior,world)
{
assert modelid >= 400 || modelid <= 611;
new v = CreateVehicle(modelid,x,y,z,a,color1,color2,respaw n_delay);
LinkVehicleToInterior(v,interior);
SetVehicleVirtualWorld(v,world);
return 1;
}

maybe problem here?


Re: Not Create Vehicle. - Shetch - 19.02.2012

Код:
for(new slots = GetMaxPlayers( ), i; i < SLOTS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(InStunt[i] == 1)
            {
                RampTimer[i] = SetTimerEx("CountDown", 1000, 1, "i", i);
                RampCD[i] = 60;
            }
        }
    }
What the....

Here's what i use.
Код:
	for(new i = 0; i < MAX_PLAYERS; i++)



Re: Not Create Vehicle. - _DownLoaD_ - 19.02.2012

Shetch - Still not helped me.


Re: Not Create Vehicle. - aRoach - 19.02.2012

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Код:
for(new slots = GetMaxPlayers( ), i; i < SLOTS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(InStunt[i] == 1)
            {
                RampTimer[i] = SetTimerEx("CountDown", 1000, 1, "i", i);
                RampCD[i] = 60;
            }
        }
    }
What the....

Here's what i use.
Код:
	for(new i = 0; i < MAX_PLAYERS; i++)
pawn Код:
for(new slots = GetMaxPlayers( ), i; i < slots; i++)
Is the fastest plain player-loop, learn my friend...


Re: Not Create Vehicle. - _DownLoaD_ - 20.02.2012

aRoach, still not orking, the bug maybe is wit the Vehicle?