Last checkpoint
#1

Removed
Reply
#2

that is called cheating sir xD
but if it is an enum pos or w/e there are ways like
SetPlayerPos(playerid, CheckPoints[points][cpPosX], CheckPoints[points][cpPosY], CheckPoints[points][cpPosZ]);
<.<...
Reply
#3

pawn Код:
new Float:X[MAX_PLAYERS],Float:Y[MAX_PLAYERS],Float:Z[MAX_PLAYERS];

public OnPlayerEnterCheckpoint(playerid)
{
    GetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);
    return 1;
}

//Strcmp
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/gotocp",false,11))
    {
        SetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);
        SendClientMessage(playerid,-1,"Teleported.");
        return 1;
    }
    return 0;
}

//Zcmd
CMD:gotocp(playerid,params[])
{
    SetPlayerPos(playerid,X[playerid],Y[playerid],Z[playerid]);
    SendClientMessage(playerid,-1,"Teleported.");
    return 1;
}
Reply
#4

Removed
Reply
#5

did you set x,y,z to global variable? you could set the x,y,z to a pvarfloat instead of global var and each player can have their own set still
also ...it will send you to the checkpoint you just passed thru ...so you need to go thru a checkpoint first
Reply
#6

Removed
Reply
#7

only use one of the CMDs if you use strcmp use the onplayercommandtext one if you use zcmd use the CMD: one and if they are set as race checkpoints use OnPlayerEnterRaceCheckpoint
Reply
#8

Removed
Reply
#9

i assume CPProgess[playerid] is the indicator for the checkpoint number to show? so to go to last you want to CPProgess[playerid]-1 like this
pawn Код:
CMD:gotolastcp(playerid,params[])
{
    SetPlayerPos(playerid,CPCoords[CPProgess[playerid]-1][0],CPCoords[CPProgess[playerid]-1][1],CPCoords[CPProgess[playerid]-1][2]);
    SendClientMessage(playerid,-1,"Teleported.");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)