Send a message to everyone near (Yeah ProxDetector)
#1

How would I make it so when they press a dialog -
pawn Код:
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid,_COLOR_GREY,"You cannot afford this!");
                {
                    SetPlayerArmour(playerid, 100);
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid, _COLOR_CYAN, "* You have choosen a Kevlar Vest!");
                    return 0;
It sends anyone close a message (Yes, using proxdetector but I haven't understood it yet) - for the purpose of determining a weapon hacker from a legit buyer.
Reply
#2

Bump.. Any help?
Reply
#3

OnDialogResponse - wiki it. Besides you have many mistakes in your code. Lemme fix it ( idk if it will be working )

pawn Код:
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid,_COLOR_GREY,"You cannot afford this!") return 1;
                {
                    SetPlayerArmour(playerid, 100);
                    GivePlayerMoney(playerid, -2000);
                    SendClientMessage(playerid, _COLOR_CYAN, "* You have chosen a Kevlar Vest!");
                    return 1;
                }
Im not so good at scripting but think it will work, lol.

// edit oh shit I've managed to mis-understood.

Use this code, for ProxDetector to work.

this forward on top of the script under defines:
pawn Код:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
This after the dialog response:

pawn Код:
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid,_COLOR_GREY,"You cannot afford this!") return 1;
                {
                    SetPlayerArmour(playerid, 100);
                    GivePlayerMoney(playerid, -2000);
                    format(string, sizeof(string), "You have chosen a Kevlar Vest!");
                    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                    return 1;
                }
All I can do lol. Hope it helped!
Reply
#4

What is this? my script works fine.. did you not read it all?
Quote:

It sends anyone close a message (Yes, using proxdetector but I haven't understood it yet) - for the purpose of determining a weapon hacker from a legit buyer.

Reply
#5

Edited..
Reply
#6

pawn Код:
error 017: undefined symbol "string"
error 017: undefined symbol "string"
error 029: invalid expression, assumed zero
Hm, also I'd need to do something like %s and get playerid to get his name saying "%s has choosen a Kelvar Vest"
Reply
#7

pawn Код:
new plname[MAX_PLAYER_NAME], string[64];
GetPlayerName(playerid,plname,sizeof(plname));
format(string, sizeof(string), "* %s  have chosen a Kevlar Vest!",plname);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
Are you talking about this?
Reply
#8

Function ProxDetector not implemented
Reply
#9

Quote:
Originally Posted by Darklom
Посмотреть сообщение
Function ProxDetector not implemented
Do you have a whole ProxDetector function or you have only this line ?
pawn Код:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
Reply
#10

Only that line :/
pawn Код:
SetPlayerArmour(playerid, 100);
                    GivePlayerMoney(playerid, -2000);
                    new plname[MAX_PLAYER_NAME], string[64];
                    GetPlayerName(playerid,plname,sizeof(plname));
                    format(string, sizeof(string), "* %s  have chosen a Kevlar Vest!",plname);
                    ProxDetector(20.0, playerid, string, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
                    return 0;
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)