how to add a pointtoplayer on fs -
Tom1412 - 14.11.2010
iv made a basic tollboth on the bridge to lv from ls but they can do /paytoll anywhere thoughout sa, and i get one error tht the script hasnt closed. can anyone help me?
PHP код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
#define COLOR_DBLUE 0x2641FEAA
new gate2;
new gate3;
new gate4;
new gate5;
forward GateClose1(playerid);
forward GateClose2(playerid);
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public OnFilterScriptInit()
{
gate2 = CreateObject(968, 1745.9000244141, 524.20001220703, 27.689956665039, 0, 90, 340);
gate4 = CreateObject(968, 1745.9362792969, 524.18157958984, 27.725173950195, 0, 90, 339.99938964844);
CreateObject(991, 1737.5550537109, 527.28869628906, 27.918104171753, 0, 0, 340);
CreateObject(991, 1742.7351074219, 525.42553710938, 27.937757492065, 0, 0, 339.99938964844);
CreateObject(991, 1755.7312011719, 520.65948486328, 27.955936431885, 0, 0, 339.99938964844);
CreateObject(991, 1724.5802001953, 531.8828125, 27.92366027832, 0, 0, 339.99938964844);
CreateObject(966, 1734.2086181641, 528.40533447266, 26.715398788452, 0, 0, 340);
CreateObject(966, 1746.1066894531, 524.16827392578, 26.725173950195, 0, 0, 160);
CreateObject(4642, 1753.1783447266, 519.68542480469, 28.541940689087, 0, 0, 250);
CreateObject(4642, 1735.9213867188, 529.79211425781, 28.306367874146, 0, 0, 249.99938964844);
return 1;
}
public GateClose1()
{
DestroyObject( gate3 );
gate2 = CreateObject(968, 1734.2583007813, 528.259765625, 27.669494628906, 0, 90, 160);
return 1;
}
public GateClose2()
{
DestroyObject( gate4 );
gate5 = CreateObject(968,1746.1977539063,524.39599609375,27.64457321167,0,0,339.99938964844);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/paytoll", true))
{
DestroyObject( gate2 );
gate3 = CreateObject(968, 1734.2001953125, 528.40203857422, 27.715398788452, 0, 0, 159.99938964844);
SetTimer("GateClose1", 6000, 0);
SendClientMessage(playerid, COLOR_DBLUE,"The gate is opened and will close in 6 seconds.");
return 1;
}
if(!strcmp(cmdtext, "/paytoll", true))
{
DestroyObject( gate5 );
gate4 = CreateObject(968, 1745.9362792969, 524.18157958984, 27.725173950195, 0, 90, 339.99938964844);
SetTimer("GateClose2", 6000, 0);
SendClientMessage(playerid, COLOR_DBLUE,"The gate is opened and will close in 6 seconds.");
return 1;
}
Re: how to add a pointtoplayer on fs -
Mean - 14.11.2010
Show us the errors please
And you cant use 2 same commands
Re: how to add a pointtoplayer on fs -
Hal - 14.11.2010
make it /paytoll1 & /paytoll2
and if in your GM you have the pointtoplayer, search for the stock and place it in.
Re: how to add a pointtoplayer on fs -
Tom1412 - 14.11.2010
PHP код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
#define COLOR_DBLUE 0x2641FEAA
new gate2;
new gate3;
forward GateClose1(playerid);
forward GateClose2(playerid);
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
forward ProxDetectorS(Float:radi, playerid, targetid);
public OnFilterScriptInit()
{
gate2 = CreateObject(968, 1745.9000244141, 524.20001220703, 27.689956665039, 0, 90, 340);
// gate4 = CreateObject(968, 1745.9362792969, 524.18157958984, 27.725173950195, 0, 90, 339.99938964844);
CreateObject(991, 1737.5550537109, 527.28869628906, 27.918104171753, 0, 0, 340);
CreateObject(991, 1742.7351074219, 525.42553710938, 27.937757492065, 0, 0, 339.99938964844);
CreateObject(991, 1755.7312011719, 520.65948486328, 27.955936431885, 0, 0, 339.99938964844);
CreateObject(991, 1724.5802001953, 531.8828125, 27.92366027832, 0, 0, 339.99938964844);
CreateObject(966, 1734.2086181641, 528.40533447266, 26.715398788452, 0, 0, 340);
CreateObject(966, 1746.1066894531, 524.16827392578, 26.725173950195, 0, 0, 160);
CreateObject(4642, 1753.1783447266, 519.68542480469, 28.541940689087, 0, 0, 250);
CreateObject(4642, 1735.9213867188, 529.79211425781, 28.306367874146, 0, 0, 249.99938964844);
return 1;
}
public GateClose1()
{
DestroyObject( gate3 );
gate2 = CreateObject(968, 1734.2583007813, 528.259765625, 27.669494628906, 0, 90, 160);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/paytoll", true))
{
if(IsPlayerInRangeOfPoint(10, playerid, 1734.2001953125,528.40203857422,27.715398788452))
GivePlayerMoney(playerid, -25);
DestroyObject( gate2 );
gate3 = CreateObject(968, 1734.2001953125, 528.40203857422, 27.715398788452, 0, 0, 159.99938964844);
SetTimer("GateClose5", 6000, 0);
SendClientMessage(playerid, COLOR_DBLUE,"The gate is opened and will close in 6 seconds.");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
PHP код:
C:\Users\tom\Desktop\Untitled.pwn(45) : error 017: undefined symbol "sendername"
C:\Users\tom\Desktop\Untitled.pwn(45) : error 017: undefined symbol "sendername"
C:\Users\tom\Desktop\Untitled.pwn(45) : error 029: invalid expression, assumed zero
C:\Users\tom\Desktop\Untitled.pwn(45) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.