SA-MP Forums Archive
Event Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Event Help (/showthread.php?tid=606592)



Event Help - SaiyanZ - 06.05.2016

Hey guys, I was trying to make event system and a command to join the event, I wanna ask how can i send a message to all players that this player has now joined the event and (number of fighters/ total) has joined, How do i get joined fighter numbers like how many players joined the event.
PHP код:
CMD:joinlms(playeridparams[])
{
    if(
LMSEventPlayer[playerid]== 1)
    {
    
SendClientMessage(playerid, -1"* Faggot, You already Joined the event! *");
    }
    else
    {
    if(
LMSEvent ==1)
    {
    new 
rand random(sizeof(RandomSpawn2));
    new 
fighters;
    
LMSEventFighters ++;
    
SetPlayerTeam(playeridNO_TEAM);
    
LMSEventPlayer[playerid] = 1;
    
SetPlayerPos(playeridRandomSpawn2[rand][0], RandomSpawn2[rand][1], RandomSpawn2[rand][2]);
    
SetPlayerVirtualWorld(playerid10);
    for(new 
GetPlayerPoolSize(); != -1; --iSetPlayerMarkerForPlayer(iplayerid0xFFFFFF00);
    
TogglePlayerControllable(playeridfalse);
    
SendClientMessage(playerid, -1" You Have Successfully Joined the Event, Wait 20 seconds till the event starts!");
    
ResetPlayerWeapons(playerid);
    
GivePlayerWeapon(playerid24999999);
    } 



Re: Event Help - Dayrion - 06.05.2016

Hello.
Like this ?
PHP код:
CMD:joinlms(playeridparams[])
{
    if(
LMSEventPlayer[playerid]== 1)
    {
        
SendClientMessage(playerid, -1"* Faggot, You already Joined the event! *");
    }
    else if(
LMSEvent ==1)
    {
        new 
rand random(sizeof(RandomSpawn2));
        new 
fightersstr[120], name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        
LMSEventFighters ++;
        
SetPlayerTeam(playeridNO_TEAM);
        
LMSEventPlayer[playerid] = 1;
        
SetPlayerPos(playeridRandomSpawn2[rand][0], RandomSpawn2[rand][1], RandomSpawn2[rand][2]);
        
SetPlayerVirtualWorld(playerid10);
        for(new 
GetPlayerPoolSize(); != -1; --iSetPlayerMarkerForPlayer(iplayerid0xFFFFFF00);
        
TogglePlayerControllable(playeridfalse);
        
SendClientMessage(playerid, -1" You Have Successfully Joined the Event, Wait 20 seconds till the event starts!");
        
format(strsizeof(str), "%s joined an event ! (Players : %i/Total)"nameLMSEventFighters);
        
SendClientMessageToAll(-1str);
        
ResetPlayerWeapons(playerid);
        
GivePlayerWeapon(playerid24999999);
    }