#10

PHP код:
CMD:dmwinner(playerid,params[])
{
    if(!
gPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_LIGHTRED"Logheazate mai intai");
    
// You can use ! which is equal to == 0
    
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,COLOR_LIGHTRED,"Nu ai nivelul de admin necesar");
    
// Shortened few lines doing the above
    
new idwprize;
    if(
sscanf(params"ui",idw,prize)) return SendClientMessage(playeridCOLOR_WHITE"{B8DBFF}Synthax: /dmwinner <Name/Playerid> <Prize>");
    if(
idw == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"Acel player nu este conectat");
    new 
str[60], name[MAX_PLAYER_NAME]; // you need to create a string to format the message below and a name array to get the player's name
    
GetPlayerName(idwnamesizeof(name)); // here we get the target player's name
    
format(str,sizeof(str), "%s a castigat eventul DM! Felicitari"name); // we have to format the message
    
SendClientMessageToAll(COLOR_GREENstr); // show the message to everybody
    
GivePlayerCash(idwprize); // give the money, amount defined using /dmwinner <playerid> <money>
    
activeevent 0;
    return 
1;

Reply


Messages In This Thread
Help - by TheDarkBlade - 21.02.2016, 06:05
Re: Help - by TheDarkBlade - 21.02.2016, 08:39
Re: Help - by SyS - 21.02.2016, 08:44
Re: Help - by TheDarkBlade - 21.02.2016, 09:15
Re: Help - by SyS - 21.02.2016, 11:09
Re: Help - by TheDarkBlade - 21.02.2016, 14:25
Re: Help - by TheDarkBlade - 21.02.2016, 16:00
Re: Help - by Hellman92 - 21.02.2016, 17:26
Re: Help - by TheDarkBlade - 21.02.2016, 18:02
Re: Help - by LocMax - 21.02.2016, 18:48

Forum Jump:


Users browsing this thread: 1 Guest(s)