[HELP] What to write here???
#1

Look, i had created a custom map and set my event round there... When anyone type /minigun1 he will TP to that area and will get minigun with unlimited ammo. But he can also goto other Teleport by using other teleports like after joining /minigun1 he can do /gotols then he will not lose his minigun Please tell me what to write so nobody can leave the /minigun1 without typing /kill... Please help ..

Код:
CMD:minigun1(playerid, params[])
{
SetPlayerPos(playerid,1367.6130,1540.9064,121.1731);
GivePlayerWeapon(playerid, 38, 22222);
GameTextForPlayer(playerid,"Welcome to Minigun Round, /Kill to quit don't fire outside cage :D",4000,6);
return 1;
}
Reply
#2

you can create a variable.Example:


pawn Код:
new VariableDeBloqueo[MAX_PLAYERS];//we create that
pawn Код:
if(VariableDeBloqueo[playerid] == 1) return SendClientMessage(playerid, -1, "Sorry, you are in DM Zone, you have to put /Kill for get out. ");//put this in the top of onplayercommandtext
and:

pawn Код:
CMD:minigun1(playerid, params[])
{
SetPlayerPos(playerid,1367.6130,1540.9064,121.1731);
GivePlayerWeapon(playerid, 38, 22222);
VariableDeBloqueo[playerid] = 1;//the variable is ON
GameTextForPlayer(playerid,"Welcome to Minigun Round, /Kill to quit don't fire outside cage :D",4000,6);
return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    VariableDeBloqueo[playerid] = 0;//the variable is off
    return 1;
}
Meabe this works.
Reply
#3

Quote:
Originally Posted by SampLoverNo123
Посмотреть сообщение
Look, i had created a custom map and set my event round there... When anyone type /minigun1 he will TP to that area and will get minigun with unlimited ammo. But he can also goto other Teleport by using other teleports like after joining /minigun1 he can do /gotols then he will not lose his minigun Please tell me what to write so nobody can leave the /minigun1 without typing /kill... Please help ..

Код:
CMD:minigun1(playerid, params[])
{
SetPlayerPos(playerid,1367.6130,1540.9064,121.1731);
GivePlayerWeapon(playerid, 38, 22222);
GameTextForPlayer(playerid,"Welcome to Minigun Round, /Kill to quit don't fire outside cage :D",4000,6);
return 1;
}
Use the ResetPlayerWeapons function. So when teleporting do ResetPlayerWeapons(playerid); then equip him/her with the minigun.

Eg.
pawn Код:
CMD:minigun1(playerid, params[]) {
SetPlayerPos(playerid,1367.6130,1540.9064,121.1731);
[B]ResetPlayerWeapons(playerid);[/B]
GivePlayerWeapon(playerid, 38, 22222);
GameTextForPlayer(playerid,"Welcome to Minigun Round, /Kill to quit don't fire outside cage :D",4000,6);
return 1;
}
Reply
#4

Thank you very much man
Reply
#5

hey man do you mind if I make you a better version? Also how many minigun DM zones do you use?
Reply
#6

pawn Код:
new bool: IsPlayerInMinigun[MAX_PLAYERS] = false;
CMD:minigun(playerid, params[])
{
    new Zone;
    if(sscanf(params, "i", Zone)) return SendClientMessage(playerid, -1, "Usage: /minigun <1> ");

    if(IsPlayerInMinigun[playerid]) return SendClientMessage(playerid, -1, "You are currently in a DM zone. /kill to leave.");

    else
    {
        if(strcmp(params, "1", true)) // Add more like this.
        {
            ResetPlayerWeapons(playerid); // Reset the players weapons before anything else
            IsPlayerInMinigun[playerid] = true; // Don't use 1 or 0 with this using bools saves memory.
            SetPlayerPos(playerid,1367.6130,1540.9064,121.1731);
            GivePlayerWeapon(playerid, 38, 0xFFF); // Truly Unlimited Ammo.
            GameTextForPlayer(playerid,"Welcome to Minigun Round, /Kill to quit don't fire outside cage :D",4000,6);
        }
    }
    return 1;
}
Sorry for double post
Reply
#7

Thank that's good too.
Reply
#8

It not helped me....
Reply
#9

Listen i have more teleports in script like /drift 1,2,3,4,5,6,7.. When i go in /minigun1 then i can easly TP to /drift1234 with that weapon .... HELP ME IF YOU CAN! :P
Reply
#10

Make a public, call the public in every teleport, inside the public check if the variable is true, and return 0, cancelling their teleport.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)