Need help on Player Connect, Death
#1

hello guys.. i made "new LOL = 0;" .. how to make if 1 player connect the LOL is +1.. ane if player death LOL is -1.. and if LOL = 0, its show "GameTextForPlayer(playerid, "~b~NO LOL", 1000, 3);" ...
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerConnect
https://sampwiki.blast.hk/wiki/OnPlayerDeath
https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

yeah.. but, how to make ? LOL +1 on player connect ?
Reply
#4

I guess you need this
pawn Код:
public OnPlayerConnect
{
     LOL++; // adds 1 to the LOL
     return 1;
}
public OnPlayerDeath
{
     LOL--; //deducts 1 from LOL
     if (LOL == 0)
     {
          //gametext function
     }

     return 1;
}
Reply
#5

no work.. but, i make like it :

pawn Код:
public OnPlayerConnect
{
     LOL++; // adds 1 to the LOL
     return 1;
}
public OnPlayerDeath
{
     LOL--; //deducts 1 from LOL
     return 1;
}

forward Win(playerid);
public Win(playerid)
{
     if (LOL == 0)
     {
          SendClientMessageToAll(COLOR_RED, "LOL !");
     }
    return 1;
}
but, no work too..
Reply
#6

u calling win? Why u using a timer tho

u dont need "playerid"
Reply
#7

Quote:
Originally Posted by mastermax7777
Посмотреть сообщение
u calling win? Why u using a timer tho

u dont need "playerid"
no work
Reply
#8

PHP код:
public OnPlayerConnect
{
     
LOL++; // adds 1 to the LOL
     
return 1;
}
public 
OnPlayerDeath
{
     
LOL--; //deducts 1 from LOL
     
SetTimer("Win", 1, false);
     return 
1;
}
forward Win();
public 
Win()
{
     if (
LOL == 0)
     {
          
SendClientMessageToAll(COLOR_RED, "LOL !");
     }
    return 
1;
} 
Reply
#9

Why the hell would you run that timer 1000 times per second? 100 ms per tick is more than enough.
Reply
#10

Код:
public OnPlayerConnect(playerid)
{
     LOL++;
     return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
     LOL--;
     if(LOL == 0) { GameTextForAll("No LOL!", 3000, 3); }
     return 1;
}
like this maybe?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)