AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help >_< (https://forums.alliedmods.net/showthread.php?t=63909)

aer0nz 12-02-2007 21:12

help >_<
 
Code:

public Loc_Check(id)
{
    new Float:gunshop[3] = {-2504.0, 150.0, -413.0};
    new origin[3]
    get_user_origin(id,origin);
   
    if(get_distance(origin, gunshop) <= 164.0) {
        client_print(id,print_chat,"* [GUN] So, what kind of weapons are you interested in?")
        Main_Menu(id)
}
    else {
        client_print(id,print_chat,"* [GUN] You must be near the gunshop in order to recieve guns!")
    }
}

okay so heres a snippet, i want it to display the menu if im near the coordinates specified, the full plugin compiles, but with a tag mismatch, and if i say my command not near the location, it says i must be near the gunshop, which is what i want, but if i do it near where i want it to work, it says im not close enough. :x

M249-M4A1 12-02-2007 21:19

Re: help >_<
 
I don't have very much experience with get_distance() but you can try this (fixed the tag mismatch error):

PHP Code:

public Loc_Check(id)
{
    new 
gunshop[3] = {-2504150, -413};
    new 
origin[3]
    
get_user_origin(id,origin);
    
    if(
get_distance(origingunshop) <= 164) {
        
client_print(id,print_chat,"* [GUN] So, what kind of weapons are you interested in?")
        
Main_Menu(id)
    }
    else {
        
client_print(id,print_chat,"* [GUN] You must be near the gunshop in order to recieve guns!")
    }




All times are GMT -4. The time now is 11:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.