Have A question !!
#1

Hello !!
I have a question want to ask that i have make a cmd when player type ex /test it's will random a checkpoint , every thing is ok. but i want to ask that when player /test > random a checkpoint(i call this random checkpoint is 0) > enter checkpoint 0 > appear a checkpoint 1( this check point is this location -572.6946,-188.0733,78.4063) > enter checkpoint 1 > will appear checkpoint random is 0 again !
Reply
#2

Quote:
Originally Posted by TYDS
Посмотреть сообщение
Hello !!
I have a question want to ask that i have make a cmd when player type ex /test it's will random a checkpoint , every thing is ok. but i want to ask that when player /test > random a checkpoint(i call this random checkpoint is 0) > enter checkpoint 0 > appear a checkpoint 1( this check point is this location -572.6946,-188.0733,78.4063) > enter checkpoint 1 > will appear checkpoint random is 0 again !
this is my random checkpoint,
Код:
new Float:Checkpoint[][] = {
{-2168.8091,820.6702,64.9275,186.7119},
{-2168.9868,796.0462,64.9427,359.3602},
{-2187.3042,795.7017,57.5561,186.5670},
{-2205.3921,795.8117,50.4726,96.9528},
{-2205.2039,820.6953,50.4423,357.6252},
{-2223.2563,820.6120,49.4412,80.0326},
{-2223.8704,796.5319,49.4383,182.8069},
{-2241.4644,786.0906,49.3921,251.7409},
{-2240.7637,753.6312,49.3808,184.6869},
{-2278.5129,747.9567,49.4393,98.2061},
{-2278.5881,767.1949,49.4453,0.1318},
{-2278.1094,788.1552,49.4453,110.1129}
};
Reply
#3

some one /test > appear checkpoint 1 (random in list location above) > enter checkpoint 1 > show a checkpoint 2 in -572.6946,-188.0733,78.4063 > enter checkpoint 2 > will return 1 checkpoint 1 but not random
Reply
#4

/test appear checkpoint1 (random in list location above) > entercheckpoint1 > will show a checkpoint2 in -572.6946,-188.0733,78.4063 > entercheckpoint 2 > back into checkpoint1 position to be random at first
Reply
#5

any i deas
Reply
#6

https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint and https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint and https://sampwiki.blast.hk/wiki/DisablePlayerCheckpoint. To get the 1st checkpoint's coords, use something like this

EDIT: nvm here i made it for you

PHP код:
new CheckFix[MAX_PLAYERS]; //on top of your script 
PHP код:
CMD:test(playerid)
{
//your code
new Float:c1,Float:c2,Float:c3;
CheckFix[playerid] = 1;
new 
Random random(sizeof(Checkpoint));
c1 Checkpoint[Random][0];
c2 Checkpoint[Random][1];
c3 Checkpoint[Random][2];
SetPlayerCheckPoint(playerid,Checkpoint[Random][0],Checkpoint[Random][1],Checkpoint[Random][2]);
return 
1;

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid,5,c1,c2,c3) && CheckFix[playerid] == 1)
    {
        
DisablePlayerCheckpoint(playerid);
        
CheckFix[playerid] = 0;
        
SetPlayerCheckpoint(playerid,-572.6946,-188.0733,78.4063);
    }
    if(
IsPlayerInRangeOfPoint(playerid,5,-572.6946,-188.0733,78.4063))
    {
        
DisablePlayerCheckpoint(playerid); 
        
SetPlayerCheckpoint(playerid,c1,c2,c3);
    }
    if(
IsPlayerInRangeOfPoint(playerid,5,c1,c2,c3) && CheckFix[playerid] == 0)
    {
        
DisablePlayerCheckpoint(playerid); 
    }
    return 
1;

Reply
#7

i will try
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)