Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: JaVeD on February 10, 2013, 12:49:04 pm
-
HY,
i want a good dm command that player type !dm then player die then player again spawn in dm without typing !dm l. player spawn in game when player type !leave to leave dm please some one can help me please post what i need to put in this script i have simple dm script already!
else if ( strcmp( cmd, "!DM", true ) == 0 )
{
SetPlayerWep(playerid, 20, 9999 };
SetPlayerHealth{playerid,100.0 };
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
SendClientMessageToAll( RED, szMsg );
return 1;
}
-
JaVeD, make a new variable ( for example, playerisondm[MAX_PLAYERS];) and set it's value to 1 when player types "!DM"
then, in public OnPlayerSpawn
[pawn]
if(playerisonDM[playerid]==1)
{
SetPlayerWep(playerid, 20, 9999 };
SetPlayerHealth{playerid,100.0 };
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
SendClientMessageToAll( RED, szMsg );
}
[/pawn]
-
Not Working :( Please can u give me this command ?
-
new DM[MAX_PLAYERS];
then
[pawn] else if ( strcmp( cmd, "!DM", true ) == 0 )
{
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else
{
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
SendClientMessageToAll( COLOR_GREEN, "Started The DM Fight" );
RemovePlayerMarker( playerid );
DM[playerid] = 1;
}
return 1;
}[/pawn]
you can edit this
put this in onplayerspawn
[pawn] if(DM[playerid] == 1) {
SendClientMessage(playerid,0xAA3333AA,"You Have Entered Into DM");
SetPlayerHealth( playerid, 100.100 );
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
}[/pawn]
put in onplayerdeath
[pawn]DM[playerid] = 0;[/pawn]
leave cmd
[pawn] else if ( strcmp( cmd, "!leave", true ) == 0 )
{
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else
{
SendClientMessageToAll( COLOR_GREEN, "DM end" );
RemovePlayerMarker( playerid );
DM[playerid] = 0;
}
return 1;
}[/pawn]
-
THNXXX MAN ITS WORKED ROCKING MAN !!!!! 8)
-
My Pleasure And Need More Help? ask here
-
Man its bugged OnPlayerDeath >> DM[playerid] = 0; then player spawn at road without typing !leave and DM[playerid] = 1; then player spawn at dm if we type or don't type !leave!
Can you fix this bug ?
-
LOL I Spawn in dm when i die hahaha without entering !DM lol man please fix this bug
-
Oh ok so lemme give u dat:
in the beginning of your gm:
[pawn]new Float:xbefore, Float:ybefore, Float:zbefore;
new playerisondm[MAX_PLAYERS];[/pawn]
then
[pawn]public OnPlayerDisconnect(playerid, reason)
{
playerisondm[playerid]=0;
return 0;
}[/pawn]
then
[pawn]public OnPlayerSpawn(playerid, classid)
{
if(playerisondm[playerid])
{
SetPlayerPos(playerid, 112.35513, -1150.53576, 31.30939, 0, 0);
}
return 1;
}[/pawn]
and then
[pawn]public OnPlayerText(playerid, text[])
{
if(strcmp(text, "!dm", true)==0)
{
GetPlayerPos(playerid, xbefore, ybefore, zbefore);
playerisondm[playerid]=1;
SetPlayerPos(playerid, 112.35513, -1150.53576, 31.30939, 0, 0);
SendClientMessage(playerid, 0xFF0000AA, "You have joined DM!");
}
else if(strcmp(text, "!leavedm", true)==0)
{
if(playerisondm[playerid])
{
playerisondm[playerid]=1;
SetPlayerPos(playerid, xbefore, ybefore, zbefore, 0, 0);
playerisondm[playerid]=0;
SendClientMessage(playerid, 0xFF0000AA, "You have left the DM!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are not on DM!");
}
return 1;
}
return 1;
}[/pawn]
-
NOT WORKING! There is too many errors in pawn man i am using GUPS but i modified the GUPS and changed the script but some of my function is GUPS function. Please change your !DM system to GUPS.
-
WORKED!!! my friends thnxx alot command worked mrockxkingbutt's command worked we need to remove DM[playerid] =0; from OnplayerDeath :D thnx u all for helping me Thank you nestwriter.
-
WORKED!!! my friends thnxx alot command worked mrockxkingbutt's command worked we need to remove DM[playerid] =0; from OnplayerDeath :D thnx u all for helping me Thank you nestwriter.
my pleasure) Use DM[playerid]=0 in public OnPlayerDisconnect(playerid), but it's for servers with registrarion sys
-
I have registration system in my server but it work without DM[playerid] =0; :D
-
NOT WORKING! There is too many errors in pawn man i am using GUPS but i modified the GUPS and changed the script but some of my function is GUPS function. Please change your !DM system to GUPS.
IS THIS SCRIPT WORKING FOR YOU ?
WORKED!!! my friends thnxx alot command worked mrockxkingbutt's command worked we need to remove DM[playerid] =0; from OnplayerDeath :D thnx u all for helping me Thank you nestwriter.
Don't make triple post next time ok ? Use <EDIT> button ;)
-
SORRY sseebbyy i am new in forum i use edit next time :D
-
HY,
i want a good dm command that player type !dm then player die then player again spawn in dm without typing !dm l. player spawn in game when player type !leave to leave dm please some one can help me please post what i need to put in this script i have simple dm script already!
else if ( strcmp( cmd, "!DM", true ) == 0 )
{
SetPlayerWep(playerid, 20, 9999 };
SetPlayerHealth{playerid,100.0 };
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
SendClientMessageToAll( RED, szMsg );
return 1;
}
Here: put this on your OnGameModeInit
[pawn]public OnGameModeInit()
{
new Acent;
Acent < 92;
new PlayerDM[Acent];
return 1;
}[/pawn]
Put this on OnPlayerConnect
[pawn]public OnPlayerConnect(playerid)
{
PlayerDM[playerid] = 0;
}[/pawn]
Put this on OnPlayerText(playerid, cmdtext)
[pawn]public OnPlayerText(playerid, cmdtext)
{
new cmd, idx;
cmd = strtok(cmdtext, idx);
if ( strcmp( cmd, "!DM", true ) == 0 )
{
SetPlayerWep(playerid, 20, 9999 };
SetPlayerHealth{playerid,100.0 };
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
SendClientMessageToAll( RED, szMsg );
return 1;
}
else if ( strcmp( cmd, "!leave", true) == 0)
{
if (PlayerDM[playerid] = 0) SendClientMessage(playerid, COLOR_RED, "[Anti-Abuse] You can not leave without being in a DM");
else
{
PlayerDM[playerid] = 0;
SetPlayerPos(playerid, X,Y,Z, 0, 0);//REPLACE X Y Z WITH YOUR PLACE TO EXIT DM
}
return 1;
}
[/pawn]
Put this on OnPlayerSpawn
[pawn]public OnPlayerSpawn(playerid, teamid)
{
if (PlayerDM[playerid] = 1) SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
return 1;
}
}[/pawn]
Any errors or something missing? tell me and i will fix it
-
HY,
i want a good dm command that player type !dm then player die then player again spawn in dm without typing !dm l. player spawn in game when player type !leave to leave dm please some one can help me please post what i need to put in this script i have simple dm script already!
else if ( strcmp( cmd, "!DM", true ) == 0 )
{
SetPlayerWep(playerid, 20, 9999 };
SetPlayerHealth{playerid,100.0 };
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
SendClientMessageToAll( RED, szMsg );
return 1;
}
Here: put this on your OnGameModeInit
[pawn]public OnGameModeInit()
{
new Acent;
Acent < 92;
new PlayerDM[Acent];
return 1;
}[/pawn]
Put this on OnPlayerConnect
[pawn]public OnPlayerConnect(playerid)
{
PlayerDM[playerid] = 0;
}[/pawn]
Put this on OnPlayerText(playerid, cmdtext)
[pawn]public OnPlayerText(playerid, cmdtext)
{
new cmd, idx;
cmd = strtok(cmdtext, idx);
if ( strcmp( cmd, "!DM", true ) == 0 )
{
SetPlayerWep(playerid, 20, 9999 };
SetPlayerHealth{playerid,100.0 };
PlayerDM[playerid] = 1;
new szMsg[172];
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
SendClientMessageToAll( RED, szMsg );
return 1;
}
else if ( strcmp( cmd, "!leave", true) == 0)
{
if (PlayerDM[playerid] = 0) SendClientMessage(playerid, COLOR_RED, "[Anti-Abuse] You can not leave without being in a DM");
else
{
PlayerDM[playerid] = 0;
SetPlayerPos(playerid, X,Y,Z, 0, 0);//REPLACE X Y Z WITH YOUR PLACE TO EXIT DM
}
return 1;
}
[/pawn]
Put this on OnPlayerSpawn
[pawn]public OnPlayerSpawn(playerid, teamid)
{
if (PlayerDM[playerid] = 1) SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
return 1;
}
}[/pawn]
Any errors or something missing? tell me and i will fix it
-
HY,
i want a good dm command that player type !dm then player die then player again spawn in dm without typing !dm l. player spawn in game when player type !leave to leave dm please some one can help me please post what i need to put in this script i have simple dm script already!
else if ( strcmp( cmd, "!DM", true ) == 0 )
{
SetPlayerWep(playerid, 20, 9999 };
SetPlayerHealth{playerid,100.0 };
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
SendClientMessageToAll( RED, szMsg );
return 1;
}
Here: put this on your OnGameModeInit
[pawn]public OnGameModeInit()
{
new Acent;
Acent < 92;
new PlayerDM[Acent];
return 1;
}[/pawn]
Put this on OnPlayerConnect
[pawn]public OnPlayerConnect(playerid)
{
PlayerDM[playerid] = 0;
}[/pawn]
Put this on OnPlayerText(playerid, cmdtext)
[pawn]public OnPlayerText(playerid, cmdtext)
{
new cmd, idx;
cmd = strtok(cmdtext, idx);
if ( strcmp( cmd, "!DM", true ) == 0 )
{
SetPlayerWep(playerid, 20, 9999 };
SetPlayerHealth{playerid,100.0 };
SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
format( szMsg, 128, "%s Started DeathMatch Want to DM with him type !dm ",gPlayers[playerid]);
SendClientMessageToAll( RED, szMsg );
return 1;
}
else if ( strcmp( cmd, "!leave", true) == 0)
{
if (PlayerDM[playerid] = 0) SendClientMessage(playerid, COLOR_RED, "[Anti-Abuse] You can not leave without being in a DM");
else
{
PlayerDM[playerid] = 0;
SetPlayerPos(playerid, X,Y,Z, 0, 0);//REPLACE X Y Z WITH YOUR PLACE TO EXIT DM
}
return 1;
}
[/pawn]
Put this on OnPlayerSpawn
[pawn]public OnPlayerSpawn(playerid, teamid)
{
if (PlayerDM[playerid] = 1) SetPlayerPos(playerid,79.8332, 1103.0068, 32.6039, 89.6475,0);
return 1;
}
}[/pawn]
Any errors or something missing? tell me and i will fix it
U missed too many lines... For example, [pawn]new szMsg[256 or your number];[/pawn]
Your code includes a lot of bugs and It's hard. Make simple codes, don't use symbols u see first times.
-
U missed too many lines... For example, [pawn]new szMsg[256 or your number];[/pawn]
Your code includes a lot of bugs and It's hard. Make simple codes, don't use symbols u see first times.
FIXED