Jump to content

Ma poate ajuta cine-va ? cand dau /joinevent pot intra in event chiar daca variabila este pe 0 ! Cand un player se conecteaza este setata pe zero !


Recommended Posts

Posted

CMD:joinevent(playerid, params[])
{
    if(Event[playerid] = 0) return SendClientMessage(playerid, 0xff0000FF, "Nu este un event activ!");
    if(Event[playerid] = 1){
        SendClientMessage(playerid, 0xff0000FF, "Ai fost teleportat la event!");
        SetPlayerPos(playerid, 2562.6992, -1283.9130, 1035.0000);
        pEvent[playerid] = 1;
        return 1;
    }
    return 1;
}

Posted

salut o poti face in doua feluri 1 find startevent si una joinevent si poti sa faci event in ce loc doresti tu 

  • Like 1

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Posted

@GamerulFOX uite ca nu am mai ajutat de mult pe aici o sa te ajut  cu startevent , joinevent , stopevent .

pps: bine inteles se mai poate face modificari sa pui si bani automat cand faci un event etc asta te preocupa pe tine ce vrei sa faci pe mai departe.

new Event_Int, Event_World, vwp[MAX_PLAYERS], innt[MAX_PLAYERS], Event_Joinable, Float: Event_Pos[3];

CMD:joinevent(playerid, params[])
{
    if(IsPlayerConnected(playerid)) 
    {
        if(!Event_Joinable) return SendClientMessage(playerid, COLOR_DARKGRAY, "There is not any event on going.");
        if(IsPlayerInRangeOfPoint(playerid, 140.0, Event_Pos[0], Event_Pos[1], Event_Pos[2])) return SendClientMessage(playerid, COLOR_DARKGRAY, "You are already taking part at this event.");
        SetPlayerInterior(playerid, Event_Int), SetPlayerVirtualWorld(playerid, Event_World);
        SetPlayerPos(playerid, Event_Pos[0], Event_Pos[1], Event_Pos[2]+1);
        ResetPlayerWeapons(playerid);
        SendClientMessage(playerid, 0xA2E261FF, "[EVENT]: You have joined the event !");
    }
    return 1;
}

CMD:startevent(playerid, params[])
{
    if(IsPlayerConnected(playerid)) 
    // Aici pui tu restrictia de admin.
    {
        GetPlayerPos(playerid, Event_Pos[0], Event_Pos[1], Event_Pos[2]);
        Event_Int = innt[playerid];
        Event_World = vwp[playerid];
        SendClientMessageToAll(playerid, 0xA2E261FF, "[EVENT]: Type /joinevent to join it !");
            
    }
    return 1;
}

CMD:stopevent(playerid, params[])
{
    // Aici pui tu restrictia de admin.
    if (Event_Pos[0] == 0.0 && Event_Pos[1] == 0.0) return SendClientMessage(playerid, COLOR_DARKGRAY, "There is no event on going.");
    SendEventMessage(0xA2E261FF, "[EVENT]: Event joins have been stopped. No one can join the event from now.");
    Event_Joinable = false;
    return 1;
}

 

  • Like 1

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Posted

Ca să verifici dacă este egal cu 0, pui ”==”, nu doar un ”=”.

 

    if(Event[playerid] == 0) return SendClientMessage(playerid, 0xff0000FF, "Nu este un event activ!");

 

    if(Event[playerid] == 1){

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.