[HELP]Checkpoint!
#1

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 ?
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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.
Reply
#5

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,...)
Reply
#6

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 "{"
Reply
#7

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;
    }
Reply
#8

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 ?
Reply
#9

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;    
     }
Reply
#10

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

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.
Reply
#12

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;
}
Reply
#13

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

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

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 ?
Reply
#16

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

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

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

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

alrighty i can do that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)