Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on December 16, 2013, 01:20:07 am
-
Hi All I Created A Duel System!
Note : Changelog! 2twice!
Add This
new Duel[MAX_PLAYERS];
Add This CMDS
else if ( strcmp( cmd, "!duel", true ) == 0 )
{
SendClientMessage(playerid,COLOR_GREEN,"Teleporting To Duel! [ Prevent BugKills ]");
SetTimer("Duels", 5000, 0);
Duel[playerid] = 1;
TogglePlayerControllable(playerid, 0);
return 1;
}
else if ( strcmp( cmd, "!exit", true ) == 0 )
{
SendClientMessage(playerid,COLOR_GREEN,"Teleporting To Exit! [ Prevent BugKills ]");
SetTimer("Exit", 5000, 0);
Duel[playerid] = 0;
TogglePlayerControllable(playerid, 0);
return 1;
}
Now The Publics & Timers
public Duels() {
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i)) {
if(Duel[i] == 1) {
SendClientMessage(i, COLOR_RED, " You Have Been Sent To Duel ");
SetPlayerPos(i,-1759.4911 ,-135.6824 ,14.8683,0,0);
TogglePlayerControllable(i, 1);
}
}
}
public Exit() {
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i)) {
if(Duel[i] == 0) {
SendClientMessage(i, COLOR_RED, " You Have Been Exited ");
SetPlayerPos(i,-818.3429 ,-355.2299 ,10.7040,0,0);
TogglePlayerControllable(i, 1);
}
}
}
Howz This!
Rate My Post Its All By me!
Also PM Me If You Liked It!
-
The timers do not work as intended. You cannot use playerid in a timer like that.
-
Edited
Changelog!
-
Your timer is calling the function "Duel" but your functions is called "Duels". Plus the way you're using your timers, it will lag the server and causes more bug. I would like to explain more but I'm on another computer.
-
Edited Again! Thanks FOr The Point
-
Are these timers really required? Bcuz it's stupid to put timers everywhere you want bcuz the code gets look longer and harder. Try not to use timers
-
Listen Mr!
If We DOnt Set Timer Peoples Will Evade In Servers!
So It WIll Needed TO Teleport In 5 Seconds With No Controlls
-
you are doing well mrockx
all the best ;)