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(playerid, params[])
{
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(playerid, NO_TEAM);
LMSEventPlayer[playerid] = 1;
SetPlayerPos(playerid, RandomSpawn2[rand][0], RandomSpawn2[rand][1], RandomSpawn2[rand][2]);
SetPlayerVirtualWorld(playerid, 10);
for(new i = GetPlayerPoolSize(); i != -1; --i) SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00);
TogglePlayerControllable(playerid, false);
SendClientMessage(playerid, -1, " You Have Successfully Joined the Event, Wait 20 seconds till the event starts!");
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 999999);
}
Re: Event Help -
Dayrion - 06.05.2016
Hello.
Like this ?
PHP код:
CMD:joinlms(playerid, params[])
{
if(LMSEventPlayer[playerid]== 1)
{
SendClientMessage(playerid, -1, "* Faggot, You already Joined the event! *");
}
else if(LMSEvent ==1)
{
new rand = random(sizeof(RandomSpawn2));
new fighters, str[120], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
LMSEventFighters ++;
SetPlayerTeam(playerid, NO_TEAM);
LMSEventPlayer[playerid] = 1;
SetPlayerPos(playerid, RandomSpawn2[rand][0], RandomSpawn2[rand][1], RandomSpawn2[rand][2]);
SetPlayerVirtualWorld(playerid, 10);
for(new i = GetPlayerPoolSize(); i != -1; --i) SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00);
TogglePlayerControllable(playerid, false);
SendClientMessage(playerid, -1, " You Have Successfully Joined the Event, Wait 20 seconds till the event starts!");
format(str, sizeof(str), "%s joined an event ! (Players : %i/Total)", name, LMSEventFighters);
SendClientMessageToAll(-1, str);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 999999);
}
}