PDA

View Full Version : Race checkpoints


Burning
01/11/2013, 08:08 PM
Im creating my dmv system and some serious problems blasts me off..I made a checkpoints and when I'm entering second checkpoint it just spams same checkpoint...What I did wrong?
Here's my code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new MasinosID = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(MasinosID == Vairavimas1 || MasinosID == Vairavimas2 || MasinosID == Vairavimas3|| MasinosID == Vairavimas4|| MasinosID == Vairavimas5|| MasinosID == Vairavimas6|| MasinosID == Vairavimas7|| MasinosID == Vairavimas8)
{
if(PlayerInfo[playerid][pTeorija] == 0){ RemovePlayerFromVehicle(playerid);SendClientMessag e(playerid,BALTA,"[SERVERIS] Tu dar nesi išlaikęs teorijos..");}
else if(PlayerInfo[playerid][pTeises] == 1){RemovePlayerFromVehicle(playerid);SendClientMes sage(playerid,BALTA,"[SERVERIS] Tu jau turi teises..");}
else
{
SendClientMessage(playerid,-1,"{FFFFFF}[{00FF00}SERVERIS{FFFFFF}]{FFFFFF} Sveiki atvykę į vairavimo mokyklos teoriją.");
SendClientMessage(playerid,-1,"{FFFFFF}[{00FF00}SERVERIS{FFFFFF}] Jums bus duota pravažiuoti 20 CP.");
SendClientMessage(playerid,-1,"{FFFFFF}[{00FF00}SERVERIS{FFFFFF}] Norint išlaikyti praktiką jums reikės:");
SendClientMessage(playerid,-1,"{FFFFFF}[{00FF00}SERVERIS{FFFFFF}] Grįžti su mašinos gyvybėmis daugiau nei {00FF00}900{FFFFFF} (/dl)");
vmcp[0] = SetPlayerRaceCheckpoint(playerid,1,-2049.8044,-83.0355,34.9235,-2086.7793,-68.1666,34.8021,10);
}
}
}
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
switch(Laiko[playerid])
{
case 0:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[1] = SetPlayerRaceCheckpoint(playerid,1,-2086.7793,-68.1666,34.8021,-2164.9990,-54.3999,34.8036,10);
}
case 1:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[2] = SetPlayerRaceCheckpoint(playerid,1,-2164.9990,-54.3999,34.8036,-2165.2217,30.6057,34.8013,10);
}
case 2:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[3] = SetPlayerRaceCheckpoint(playerid,1,-2165.2217,30.6057,34.8013,-2144.4939,203.4300,34.8402,10);
}
case 3:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[4] = SetPlayerRaceCheckpoint(playerid,1,-2144.4939,203.4300,34.8402,-2189.5740,211.0705,34.8036,10);
}
case 4:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[5] = SetPlayerRaceCheckpoint(playerid,1,-2189.5740,211.0705,34.8036,-2144.4939,203.4300,34.8402,10);
}
case 5:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[6] = SetPlayerRaceCheckpoint(playerid,1,-2144.4939,203.4300,34.8402,-2189.5740,211.0705,34.8036,10);
}
case 6:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[7] = SetPlayerRaceCheckpoint(playerid,1,-2144.4939,203.4300,34.8402,-2255.0642,195.9899,34.8116,10);
}
case 7:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[8] = SetPlayerRaceCheckpoint(playerid,1,-2255.0642,195.9899,34.8116,-2266.2112,52.0639,34.7996,10);
}
case 8:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[9] = SetPlayerRaceCheckpoint(playerid,1,-2266.2112,52.0639,34.7996,-2374.1160,-0.3883,34.7958,10);
}
case 9:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[10] = SetPlayerRaceCheckpoint(playerid,1,-2374.1160,-0.3883,34.7958,-2373.9336,-73.3225,34.9129,10);
}
case 10:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[11] = SetPlayerRaceCheckpoint(playerid,1,-2373.9336,-73.3225,34.9129,-2330.5479,-192.4094,34.8036,10);
}
case 11:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[12] = SetPlayerRaceCheckpoint(playerid,1,-2330.5479,-192.4094,34.8036,-2259.4709,-192.3915,34.8036,10);
}
case 12:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[13] = SetPlayerRaceCheckpoint(playerid,1,-2259.4709,-192.3915,34.8036,-2166.3682,-105.6784,34.8036,10);
}
case 13:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[14] = SetPlayerRaceCheckpoint(playerid,1,-2166.3682,-105.6784,34.8036,-2165.4077,-22.9358,34.8036,10);
}
case 14:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[15] = SetPlayerRaceCheckpoint(playerid,1,-2165.4077,-22.9358,34.8036,-2144.8530,28.2876,34.8036,10);
}
case 15:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[16] = SetPlayerRaceCheckpoint(playerid,1,-2144.8530,28.2876,34.8036,-2089.7117,17.4647,34.8035,10);
}
case 16:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[17] = SetPlayerRaceCheckpoint(playerid,1,-2089.7117,17.4647,34.8035,-2089.5483,-65.3231,34.8112,10);
}
case 17:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[18] = SetPlayerRaceCheckpoint(playerid,1,-2089.5483,-65.3231,34.8112,-2047.0007,-72.4915,34.7999,10);
}
case 18:
{
DisablePlayerRaceCheckpoint(playerid);
vmcp[19] = SetPlayerRaceCheckpoint(playerid,1,-2047.0007,-72.4915,34.7999,-2033.5214,-96.1890,34.9203,10);
}
case 19:
{
new const vehicleid = GetPlayerVehicleID(playerid);
DisablePlayerRaceCheckpoint(playerid);
PlayerInfo[playerid][pTeises] = 1;
SetVehicleToRespawn(vehicleid);
SendClientMessage(playerid,-1,"{FFFFFF}[{FF3666}SERVERIS{FFFFFF}] {00FF00}Sveikiname{FFFFFF}! Išlaikėte praktiką ir gavote teises!");
}
}
return 1;
}

Blademaster680
01/11/2013, 08:24 PM
What is spamming the chat and when is it being spammed?

Burning
02/11/2013, 07:13 AM
It spams vmcp[1] checkpoint when I'm entering it.