how to add a pointtoplayer on fs
#1

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:radiplayeridFloat:xFloat:yFloat:z);
public 
OnFilterScriptInit()         
{
    
gate2 CreateObject(9681745.9000244141524.2000122070327.689956665039090340);
    
gate4 CreateObject(9681745.9362792969524.1815795898427.725173950195090339.99938964844);
    
CreateObject(9911737.5550537109527.2886962890627.91810417175300340);
    
CreateObject(9911742.7351074219525.4255371093827.93775749206500339.99938964844);
    
CreateObject(9911755.7312011719520.6594848632827.95593643188500339.99938964844);
    
CreateObject(9911724.5802001953531.882812527.9236602783200339.99938964844);
    
CreateObject(9661734.2086181641528.4053344726626.71539878845200340);
    
CreateObject(9661746.1066894531524.1682739257826.72517395019500160);
    
CreateObject(46421753.1783447266519.6854248046928.54194068908700250);
    
CreateObject(46421735.9213867188529.7921142578128.30636787414600249.99938964844);
    return 
1;
}
public 
GateClose1()
{
      
DestroyObjectgate3 );
      
gate2 CreateObject(9681734.2583007813528.25976562527.669494628906090160);
      return 
1;
}
public 
GateClose2()
{
      
DestroyObjectgate4 );
      
gate5 CreateObject(968,1746.1977539063,524.39599609375,27.64457321167,0,0,339.99938964844);
      return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/paytoll"true))
{
    
DestroyObjectgate2 );
     
gate3 CreateObject(9681734.2001953125528.4020385742227.71539878845200159.99938964844);
    
SetTimer("GateClose1"60000);
    
SendClientMessage(playeridCOLOR_DBLUE,"The gate is opened and will close in 6 seconds.");
    return 
1;
}
    if(!
strcmp(cmdtext"/paytoll"true))
{
    
DestroyObjectgate5 );
     
gate4 CreateObject(9681745.9362792969524.1815795898427.725173950195090339.99938964844);
    
SetTimer("GateClose2"60000);
    
SendClientMessage(playeridCOLOR_DBLUE,"The gate is opened and will close in 6 seconds.");
    return 
1;

Reply
#2

Show us the errors please
And you cant use 2 same commands
Reply
#3

make it /paytoll1 & /paytoll2

and if in your GM you have the pointtoplayer, search for the stock and place it in.
Reply
#4

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:radiplayeridFloat:xFloat:yFloat:z);
forward ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5);
forward ProxDetectorS(Float:radiplayeridtargetid);
public 
OnFilterScriptInit()
{
    
gate2 CreateObject(9681745.9000244141524.2000122070327.689956665039090340);
   
// gate4 = CreateObject(968, 1745.9362792969, 524.18157958984, 27.725173950195, 0, 90, 339.99938964844);
    
CreateObject(9911737.5550537109527.2886962890627.91810417175300340);
    
CreateObject(9911742.7351074219525.4255371093827.93775749206500339.99938964844);
    
CreateObject(9911755.7312011719520.6594848632827.95593643188500339.99938964844);
    
CreateObject(9911724.5802001953531.882812527.9236602783200339.99938964844);
    
CreateObject(9661734.2086181641528.4053344726626.71539878845200340);
    
CreateObject(9661746.1066894531524.1682739257826.72517395019500160);
    
CreateObject(46421753.1783447266519.6854248046928.54194068908700250);
    
CreateObject(46421735.9213867188529.7921142578128.30636787414600249.99938964844);
    return 
1;
}
public 
GateClose1()
{
      
DestroyObjectgate3 );
      
gate2 CreateObject(9681734.2583007813528.25976562527.669494628906090160);
      return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/paytoll"true))
    {
    if(
IsPlayerInRangeOfPoint(10playerid1734.2001953125,528.40203857422,27.715398788452))
    
GivePlayerMoney(playerid, -25);
    
DestroyObjectgate2 );
    
gate3 CreateObject(9681734.2001953125528.4020385742227.71539878845200159.99938964844);
    
SetTimer("GateClose5"60000);
    
SendClientMessage(playeridCOLOR_DBLUE,"The gate is opened and will close in 6 seconds.");
    
GetPlayerName(playeridsendernamesizeof(sendername));
     
format(stringsizeof(string), "* %s takes his/her remote and opens the gate."sendername);
    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

PHP код:
C:\Users\tom\Desktop\Untitled.pwn(45) : error 017undefined symbol "sendername"
C:\Users\tom\Desktop\Untitled.pwn(45) : error 017undefined symbol "sendername"
C:\Users\tom\Desktop\Untitled.pwn(45) : error 029invalid expressionassumed zero
C
:\Users\tom\Desktop\Untitled.pwn(45) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)