SA-MP Forums Archive
[HELP]Checkpoint! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Checkpoint! (/showthread.php?tid=196350)

Pages: 1 2


[HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

Is there a posibility to make an red circle / rec checkpoint on a location and if you get in that parameter a message to appear ?

Like : I go into that circle and the message appears : Command /buydrugs ?


Re: [HELP]Checkpoint! - SparkZ_ - 05.12.2010

Quote:
Originally Posted by [Aka]Dragonu
Посмотреть сообщение
Is there a posibility to make an red circle / rec checkpoint on a location and if you get in that parameter a message to appear ?

Like : I go into that circle and the message appears : Command /buydrugs ?
First create it with:

pawn Код:
SetPlayerCheckpoint(playerid,Float:x,Float:y,Float:z,Float:size);
Then when he enters it, do something

Note:You can only have one checkpoint, otherwise use a streamer!

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
        //do something
    return 1;
}



Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

Ok but I don't want that red circle to be shown on my gps . Is that possible ? I want to make it like a simple pickup icon.


Re: [HELP]Checkpoint! - SparkZ_ - 05.12.2010

Quote:
Originally Posted by [Aka]Dragonu
Посмотреть сообщение
Ok but I don't want that red circle to be shown on my gps . Is that possible ? I want to make it like a simple pickup icon.
No.

Unless, you could use?:


pawn Код:
SetPlayerMapIcon(playerid, iconid, Float:x, Float:y, Float:z, markertype, color, style);
https://sampwiki.blast.hk/wiki/MapIcons

To hide it.

ID: 1 the white sqaure, you can change it's colour to the background colour on the radar.


Re: [HELP]Checkpoint! - SkizzoTrick - 05.12.2010

No,it's not,the checkpoint need to appear on the radar,you could use
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,15.0,x,y,z)// where x,y,z are checkpoints coords
{
SetPlayerCheckpoint(playerid,...)



Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

I made this
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,15.0,-78.2537,-1135.9974,1.0781)// where x,y,z are checkpoints coords
    {
    SetPlayerCheckpoint(playerid, -78.2537, -1135.9974, 1.0781, 5);
    return 1;
    }
But here's the error :
pawn Код:
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4998) : error 001: expected token: ")", but found "{"



Re: [HELP]Checkpoint! - SparkZ_ - 05.12.2010

Quote:
Originally Posted by [Aka]Dragonu
Посмотреть сообщение
I made this
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,15.0,-78.2537,-1135.9974,1.0781)// where x,y,z are checkpoints coords
    {
    SetPlayerCheckpoint(playerid, -78.2537, -1135.9974, 1.0781, 5);
    return 1;
    }
But here's the error :
pawn Код:
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(4998) : error 001: expected token: ")", but found "{"
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,15.0,-78.2537,-1135.9974,1.0781))// where x,y,z are checkpoints coords
    {
    SetPlayerCheckpoint(playerid, -78.2537, -1135.9974, 1.0781, 5);
    return 1;
    }



Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

Still doesn't appear . If you know how to do it , i will pay you . I need to make a red circle there that if you go in it it says : /depositdrugs , /withdrawdrugs . Can you do that ?


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

ill try to help this may/ may not work
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 10, -78.2537 , -1135.9974, 1.0781))// where x,y,z are checkpoints coords  
     
     SendClientMessage(playerid, COLOR_HERE, "Would you like to /storedrugs, /withdraw drugs");
     SetPlayerCheckpoint(playerid, -78.2537, -1135.9974, 1.0781, 5);    
     return 1;    
     }



Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

oh so you want the red cirlce o appear when there in the range of point?


Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

Hmm i don't understand that language I just want a goddamn redcircle that if a player goes in it to say : deposit drugs and withdraw drugs . I don't want it to appear on my gps or else.


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

This might work i believe
pawn Код:
if (strcmp("/storedrugs", cmdtext, true) == 0)
     {  
     SetPlayerCheckpoint(playerid, -78.2537, -1135.9974, 1.0781, 5);
     SendClientMessage(playerid, COLOR_HERE, "Goto the place where you Store/Withdraw your drugs");
     return 1;    
     }
Then when the CheckPoint appears
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    SendClientMessage(playerid, COLOR_HERE, "You Have Reached a Place to Store/Withdraw your drugs);    
    return 1;
}



Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

Hmm . Not , never mind i will pay someone to make it XD . Thank you for your help anyways !


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

i can make one that doesnt show up on map but it will be like a white arrow or somethign or a I


Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

I can make that too . But can you convert me too commands ?

pawn Код:
dcmd_depositdrugs(playerid, params[])
{
    if(IsPlayerInCheckpoint(playerid))
    {
        new amount;
        if(sscanf(params, "d", amount))
        {
            return SendClientMessage(playerid, COLOR_RED, "SERVER: Usage: /depositdrugs [amount]");
        }
        else if(amount > Drugs[playerid] || amount <= 0)
        {
            return SendClientMessage(playerid, COLOR_RED, "SERVER: Invalid amount");
        }
        else
        {
            new str[64];
            Drugs[playerid] -= amount;
            PlayerInfo[playerid][pDrugs] += amount;
            format(str, 64, "*You have deposited %d grams of drugs", amount);
            SendClientMessage(playerid, COLOR_YELLOW, str);
            format(str, 64, "*You now have %d grams of drugs in your safe", PlayerInfo[playerid][pDrugs]);
            SendClientMessage(playerid, COLOR_YELLOW, str);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "SERVER: You need to be in a drug checkpoint to use this command");
    }
    return 1;
}

dcmd_withdrawdrugs(playerid, params[])
{
    if(IsPlayerInCheckpoint(playerid))
    {
        new amount;
        if(sscanf(params, "d", amount))
        {
            return SendClientMessage(playerid, COLOR_RED, "SERVER: Usage: /withdrawdrugs [amount]");
        }
        else if(amount > PlayerInfo[playerid][pDrugs] || amount <= 0)
        {
            return SendClientMessage(playerid, COLOR_RED, "SERVER: Invalid amount");
        }
        else
        {
            new str[64];
            Drugs[playerid] += amount;
            PlayerInfo[playerid][pDrugs] -= amount;
            format(str, 64, "*You have withdrawn %d grams of drugs", amount);
            SendClientMessage(playerid, COLOR_YELLOW, str);
            format(str, 64, "*You now have %d grams of drugs in your safe", PlayerInfo[playerid][pDrugs]);
            SendClientMessage(playerid, COLOR_YELLOW, str);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "SERVER: You need to be in a drug checkpoint to use this command");
    }
    return 1;
}
instead of player enter checkpoint i want :
pawn Код:
if (PlayerToPoint(8, playerid,-78.2537,-1135.9974,1.0781,))
and i want to make it like :
pawn Код:
if(strcmp(cmd, "/withdraw", true) == 0)
Can you do that ?


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

Ehh im not good with dcmd, or you want me re wright them?


Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

Yeah i know that . Can you convert me those 2 commands please ?


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

wait so you want them in a differnt script style like strtok?


Re: [HELP]Checkpoint! - [Aka]Dragonu - 05.12.2010

yeah . like the examples i gave you with PlayerToPoint and /withdraw


Re: [HELP]Checkpoint! - fangoth1 - 05.12.2010

alrighty i can do that