[HELP] --------> [PLEASE]
#1

Ok guys i have again problem...
i make that /teleport menu to dont give me weapons when ill click teleport location but i have other problem...
when ill get in Checkpoint with car again the player can teleport to the place !!! btw i dont want to can that cause its not so cool !!! here is my script:

THIS IS MY GAMEMODE AND I START IT NOW

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#pragma tabsize 0
#include <a_samp>
#define weaponmenu 1
#if defined FILTERSCRIPT

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Macedonian Server !!!");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    SetGameModeText("MKD Skopje");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 154.18991088867, -1951.9382324219, 51.34375);
    SetPlayerCameraPos(playerid, 154.13497924805, -1944.8223876953, 51.34375);
    SetPlayerCameraLookAt(playerid, 154.13497924805, -1944.8223876953, 51.34375);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new playercash;
    if(killerid == INVALID_PLAYER_ID) {
        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
        ResetPlayerMoney(playerid);
    } else {
            SendDeathMessage(killerid,playerid,reason);
            SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
            playercash = GetPlayerMoney(playerid);
            if (playercash > 0)  {
                GivePlayerMoney(killerid, playercash);
                ResetPlayerMoney(playerid);
            }
            else
            {
            }
         }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/rules", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Hello! This is not DM Server if admin catch you going against the rules u will be permamently banned!");
        SendClientMessage(playerid, 0xFF0000AA, "Please Respect the rules...");
        SendClientMessage(playerid, 0xFF0000AA, "You can kill player if he rob/rape you");
        SendClientMessage(playerid, 0xFF0000AA, "Enjoy Playing In This Server!!!");
        return 1;
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 2.5, 1929.91796875, -1776.3956298828, 12.467615127563))
    {
    SetPlayerPos(playerid, 2543.462646,-1308.379882,1026.728393);
    SetPlayerInterior(playerid, 2);
    SendClientMessage(playerid, 0x00FF00, "Welcome In The Building.");
    }
    else
     if(IsPlayerInRangeOfPoint(playerid, 3.0, 1498.4581298828, -1586.6020507813, 13.546875))
    {
    SetPlayerPos(playerid, 2527.654052,-1679.388305,1015.498596);
    SetPlayerInterior(playerid, 1);
    SendClientMessage(playerid, 0x00FF00, "Welcome In The Building.");
    }
        else
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1788.3591308594, -1292.9477539063, 13.57178401947))
    {
    SetPlayerPos(playerid, 1775.5197753906, -1302.20703125, 119.83050537109);
    SetPlayerInterior(playerid, 0);
    SendClientMessage(playerid, 0x00FF00, "Welcome In The Building.");
    }
    else
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1788.3591308594, -1292.9477539063, 13.57178401947))
    ShowPlayerDialog(playerid, weaponmenu, DIALOG_STYLE_LIST, "Weapons Menu", "\nShawn-Off" "\nTec9" "\nArmor" "\nSniper", "Select", "Cancel");
    return 1;
}


public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1929.91796875, -1776.3956298828, 12.467615127563))
        SetPlayerCheckpoint(playerid,1929.91796875, -1776.3956298828, 12.467615127563, 2.5);
    else
     if(IsPlayerInRangeOfPoint(playerid, 10.0, 1498.4581298828, -1586.6020507813, 13.546875))
        SetPlayerCheckpoint(playerid, 1498.4581298828, -1586.6020507813, 13.546875, 3.0);
        else
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1788.3591308594, -1292.9477539063, 13.57178401947))
        SetPlayerCheckpoint(playerid, 1788.3591308594, -1292.9477539063, 13.57178401947, 2.0);
    else
    if(IsPlayerInRangeOfPoint(playerid, 8.0, 1788.3591308594, -1292.9477539063, 13.57178401947))
        SetPlayerCheckpoint(playerid, 1788.3591308594, -1292.9477539063, 13.57178401947, 2.0);
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == weaponmenu)
    {
        if(response)
        {
            if(listitem == 0)
             {
            GivePlayerWeapon(playerid, 26, 5004);
            return 1;
            }
            if(listitem == 1)
            {
            GivePlayerWeapon(playerid, 32, 5100);
            return 1;
            }
            if(listitem == 2)
            {
            SetPlayerArmour(playerid, 100.0);
            return 1;
            }
            if(listitem == 3)
            {
            GivePlayerWeapon(playerid, 34, 5000);
            }
        }
    }
    return 1;
}
Some1 help or if u can't understand my english come in my server jsut to see that and u will get it
here is the ip:
77.29.157.196:7777

And btw how to make checkpoint when am in car and when ill enter in the checkpoint to give me to tune my car

And one more question... how to make when ill click that location or that gun to take player money GetPlayerMoney(playerid, .... );


Thanks homie's !
Reply
#2

no1 help; ??
Reply
#3

Well first dont use OnPlayerUpdate for those coordinates, this will provide too much lag (try to make a timer or something ?)

And second,

You dont have to put tags for every menu item, this is also good/cleaner:

pawn Код:
"Weapons Menu\nShawn-Off\nTec9\nArmor\nSniper"
And third, check your code:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.5, 1929.91796875, -1776.3956298828, 12.467615127563)) //if player is near that location
    {
    SetPlayerPos(playerid, 2543.462646,-1308.379882,1026.728393); //teleport player
    SetPlayerInterior(playerid, 2); //set interrior
    SendClientMessage(playerid, 0x00FF00, "Welcome In The Building."); //Send message
    }
That is the for each checkpoint and its location the script, so change that to this:

pawn Код:
//IsPLayerInRangeOfPoint etc (same)
    if(IsPlayerInRangeOfPoint(playerid, 2.5, 1929.91796875, -1776.3956298828, 12.467615127563)) //if player is near that location
    {
    GivePlayerWeapon(playerid,38,500); //gives player minigun xD with 500 bullets
    }
And for the autotune check out AddVehicleComponent at the wiki.
Reply
#4

ok man i want to can't enter in the checkpoint with car !
Do u understand ? o_0 :S
Reply
#5

Quote:
Originally Posted by [Lsrcr]Rafa
Посмотреть сообщение
ok man i want to can't enter in the checkpoint with car !
Do u understand ? o_0 :S
Oh thats easy:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.5, 1929.91796875, -1776.3956298828, 12.467615127563))
{
    if (!IsPlayerInAnyVehicle(playerid))
    {
        SetPlayerPos(playerid, 2543.462646,-1308.379882,1026.728393);
        SetPlayerInterior(playerid, 2);
        SendClientMessage(playerid, 0x00FF00, "Welcome In The Building.");
    }
}
Reply
#6

ohh ok ill try this
Thanks !
Reply
#7

ohh btw why when ill enter in some check point sending me much much ClientMessages o_0
i just want one message like "welcome in the building" or something when ill use for help i just want to send once not much times...

Thanks for the BIG help gamer931215
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)