16.05.2013, 12:00
(
Последний раз редактировалось Rimmon; 17.05.2013 в 10:08.
)
DM Zones
Hello guys , in this tutorial i'm going to show you how to make a DM ( Death match ) zone
It is so simple , you must follow some steps
Step I:
New variable
We must create a new variable who's gonna verify if the player is in a DM or not
You must create a variable with [ MAX_PLAYERS ]because it must be a variable for a player not a global variable
Step II:
Making a DM Zone by command
If you wanna to make a DM zone available you must set the variable which we created to 1
Ex:
Step III:
Verification
In this step , i'll show you how to verify if the player is in a DM or not
We must use if to verify if the player is in a DM or NOT
With the upper code the script will verify if the player is in a DM
if DM is set to 1 he'll can't use a command , if DM is set to 0 he'll can use the command
What SendClientMessage mean ?
Well , SendClientMessage send a message to player who try to use a command or make a action
SendClientMessage ( playerid , color , message [ ] ) ;
playerid - The player who the message will be send
color - the text color
message - the text who will be sent to a player
Ex:
I hope i helped you
If i wrong something reply xD
Sorry for my bad english
Hello guys , in this tutorial i'm going to show you how to make a DM ( Death match ) zone
It is so simple , you must follow some steps
Step I:
New variable
We must create a new variable who's gonna verify if the player is in a DM or not
pawn Код:
new
DM [ MAX_PLAYERS ]
;
Step II:
Making a DM Zone by command
If you wanna to make a DM zone available you must set the variable which we created to 1
pawn Код:
DM [ playerid ] = 1 ;
Ex:
pawn Код:
CMD:gotodm ( playerid , params [ ] )
{
DM [ playerid ] = 1 ;
return 1 ;
}
Verification
In this step , i'll show you how to verify if the player is in a DM or not
We must use if to verify if the player is in a DM or NOT
pawn Код:
if ( DM [ playerid ] == 1 ) return SendClientMessage ( playerid , -1 , " You can't use this command in a DM " ) ;
if DM is set to 1 he'll can't use a command , if DM is set to 0 he'll can use the command
What SendClientMessage mean ?
Well , SendClientMessage send a message to player who try to use a command or make a action
SendClientMessage ( playerid , color , message [ ] ) ;
playerid - The player who the message will be send
color - the text color
message - the text who will be sent to a player
Ex:
pawn Код:
CMD:gotodm ( playerid , params [ ] )
{
if ( DM [ playerid ] == 1 ) return SendClientMessage ( playerid , -1 , " You can't use this command in a DM " ) ;
else
{
SetPlayerPos ( playerid , 0.0 , 0.0 , 0.0 );
}
return 1 ;
}
If i wrong something reply xD
Sorry for my bad english