hali!
Egy versenyt akarnék csinálni csak nem sikerül.
A hiba hogy az elsõ CP után azt írja ki, hogy a verseny végére értél.
Gondolom hogy ahogy bemegy az elsõbe lefut az összes többi utasítás is. Hogy tudom kijavítani?
Elõre is köszönöm.
Ja és a script:
[pawn]#include <a_samp>
#include <zcmd>
new checkpoints[18];
new cel;
CMD:race(playerid,params[])
{
sPlayerPos(playerid,2045.7445,1360.8739,10.2429,0,0);
SetPlayerCheckpoint(playerid,2047.3328,1111.7773,10.2429,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[0]);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetPVarInt(playerid,\"CP\") == checkpoints[0])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2015.4202,847.9307,6.2977,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[1]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[1])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1791.1125,817.5202,10.3641,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[2]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[2])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1631.8530,216.9445,30.7127,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[3]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[3])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1701.1248,-636.8368,40.6468,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[4]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[4])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1576.2233,-1413.4781,28.0421,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[5]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[5])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1693.2444,-1543.3309,23.1510,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[6]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[6])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2113.5508,-1537.3674,2.0323,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[7]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[7])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2720.7590,-1629.2537,12.4153,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[8]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[8])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2890.6548,-1621.0668,10.4455,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[9]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[9])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2894.3796,-935.4986,10.4460,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[10]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[10])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2752.1931,-371.6379,24.4416,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[11]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[11])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2776.1350,191.8326,19.8359,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[12]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[12])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1704.2252,397.0681,29.9643,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[13]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[13])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1825.7363,837.4744,9.9731,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[14]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[14])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2070.1272,867.7535,6.4078,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[15]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[15])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2086.0061,1373.9753,10.2429,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[16]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[16])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2159.8550,1428.2513,10.3912,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[17]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[17])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2247.2556,1465.3269,10.2428,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[17]);
}
if(GetPVarInt(playerid,\"CP\") == cel)
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2306.2717,1494.6664,10.3943,8.5);
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_LIGHTGREEN,\"A verseny végére értél!\");
}
return 1;
}[/pawn]
Errort, Warningot nem jelez.
Egy versenyt akarnék csinálni csak nem sikerül.
A hiba hogy az elsõ CP után azt írja ki, hogy a verseny végére értél.
Gondolom hogy ahogy bemegy az elsõbe lefut az összes többi utasítás is. Hogy tudom kijavítani?
Elõre is köszönöm.
Ja és a script:
[pawn]#include <a_samp>
#include <zcmd>
new checkpoints[18];
new cel;
CMD:race(playerid,params[])
{
sPlayerPos(playerid,2045.7445,1360.8739,10.2429,0,0);
SetPlayerCheckpoint(playerid,2047.3328,1111.7773,10.2429,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[0]);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetPVarInt(playerid,\"CP\") == checkpoints[0])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2015.4202,847.9307,6.2977,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[1]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[1])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1791.1125,817.5202,10.3641,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[2]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[2])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1631.8530,216.9445,30.7127,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[3]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[3])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1701.1248,-636.8368,40.6468,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[4]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[4])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1576.2233,-1413.4781,28.0421,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[5]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[5])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1693.2444,-1543.3309,23.1510,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[6]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[6])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2113.5508,-1537.3674,2.0323,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[7]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[7])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2720.7590,-1629.2537,12.4153,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[8]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[8])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2890.6548,-1621.0668,10.4455,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[9]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[9])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2894.3796,-935.4986,10.4460,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[10]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[10])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2752.1931,-371.6379,24.4416,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[11]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[11])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2776.1350,191.8326,19.8359,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[12]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[12])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1704.2252,397.0681,29.9643,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[13]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[13])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,1825.7363,837.4744,9.9731,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[14]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[14])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2070.1272,867.7535,6.4078,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[15]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[15])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2086.0061,1373.9753,10.2429,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[16]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[16])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2159.8550,1428.2513,10.3912,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[17]);
}
if(GetPVarInt(playerid,\"CP\") == checkpoints[17])
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2247.2556,1465.3269,10.2428,8.5);
SetPVarInt(playerid,\"CP\",checkpoints[17]);
}
if(GetPVarInt(playerid,\"CP\") == cel)
{
DeletePVar(playerid,\"CP\");
SetPlayerCheckpoint(playerid,2306.2717,1494.6664,10.3943,8.5);
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_LIGHTGREEN,\"A verseny végére értél!\");
}
return 1;
}[/pawn]
Errort, Warningot nem jelez.
