25.08.2010, 23:30
I dont know why my CP dont wanna create on map....
This code under is for seting "polaganje" on 1
And when i enter car it dont create CP on map, can someone help me?
This code under is for seting "polaganje" on 1
pawn Код:
COMMAND:school(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid,2.0,1490.6835,1305.7798,1093.2964))
{
if(GetPlayerMoney(playerid) < 2500)
{
SCM(playerid,siva,"You dont have 2,500$");
return 1;
}
SetPVarInt(playerid,"Polaganje",1);
SetPlayerPos(playerid,2107.1477,-1363.2452,23.9844);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SCM(playerid,plava,"Take one car from this 4");
}
else
{
SCM(playerid,siva,"You are not in school");
}
return 1;
}
pawn Код:
new
vehicleid = GetPlayerVehicleID(playerid);
if(newstate == 2)
{
if(GetPVarInt(playerid,"Polaganje") == 1)
{
SetPVarInt(playerid,"CP",1);
SCM(playerid,zuta,"Now drive to red marken on your map");
SetPlayerCheckpoint(playerid,2072.2480,-1335.5364,23.5632,4.0);
}
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
new
Float:X,
Float:Y,
Float:Z;
GetPlayerPos(playerid,X,Y,Z);
if(GetPVarInt(playerid,"Polaganje") == 1)
{
if(GetPVarInt(playerid,"CP") == 1)
{
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid,"CP",2);
SetPlayerCheckpoint(playerid,1882.8817,-1259.5763,13.1467,4.0);
PlayerPlaySound(playerid, 1057, X, Y, Z);
}
if(GetPVarInt(playerid,"CP") == 2)
{
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid,"CP",3);
SetPlayerCheckpoint(playerid,1673.7355,-1297.2312,13.7606,4.0);
PlayerPlaySound(playerid, 1057, X, Y, Z);
}
if(GetPVarInt(playerid,"CP") == 3)
{
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid,"CP",4);
SetPlayerCheckpoint(playerid,1467.2727,-1297.9231,13.1598,4.0);
PlayerPlaySound(playerid, 1057, X, Y, Z);
}
if(GetPVarInt(playerid,"CP") == 4)
{
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid,"CP",5);
SetPlayerCheckpoint(playerid,1457.8223,-1180.4172,22.6265,4.0);
PlayerPlaySound(playerid, 1057, X, Y, Z);
}
if(GetPVarInt(playerid,"CP") == 5)
{
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid,"CP",6);
SetPlayerCheckpoint(playerid,1195.9303,-1140.7944,23.4609,4.0);
PlayerPlaySound(playerid, 1057, X, Y, Z);
}