Jump to content

Question

Posted

Cum transform o comanda din Dcmd in CMD ...

Am aceasca comanda

dcmd_setallcash(playerid,params[]) {
	if(PlayerInfo[playerid][Level] >= 3) {
	    if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /setallcash [Amount]");
		new var = strval(params), string[128];
       	CMDMessageToAdmins(playerid,"SETALLCASH");
		for(new i = 0; i < MAX_PLAYERS; i++) {
			if(IsPlayerConnected(i)) {
				PlayerPlaySound(i,1057,0.0,0.0,0.0);
				ResetPlayerMoney(i);
				GivePlayerMoney(i,var);
			}
		}
		format(string,sizeof(string),"Administrator \"%s\" has set all players cash to '$%d'", pName(playerid), var );
		return SendClientMessageToAll(blue, string);
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}

5 answers to this question

Recommended Posts

Posted

[pawn]CMD:setallcash(playerid,params[])

{

if(PlayerInfo[playerid][Level] >= 3)

{

    //----------------------------------------------------------------------

    if(sscanf(params, "i", givepid)) return

    SendClientMessage(playerid, LIGHTBLUE2, "Usage: /setallcash [Value]") &&

SendClientMessage(playerid, orange, "Function: Will set a specified value in Money for all players");

//----------------------------------------------------------------------

new var = givepid, string[128];

      SendCommandToAdmins(playerid,"SetAllCash");

for(new i = 0; i < MAX_PLAYERS; i++)

{

if(IsPlayerConnected(i))

{

PlayerPlaySound(i,1057,0.0,0.0,0.0);

ResetPlayerMoney(i);

GivePlayerMoney(i,var);

}

}

format(string,sizeof(string),"|- Administrator \"%s\" has set all Players Cash to '$%d' -|", pName(playerid), var );

return SendClientMessageToAll(blue, string);

}

else return ErrorMessages(playerid, 1);

}[/pawn]

Drift Moment In development

Posted

[pawn]D:\Sa-MP\RXS\RXS\pawno\include\sscanf2.inc(305) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Sa-MP\RXS\RXS\pawno\include\sscanf2.inc(305) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Sa-MP\RXS\RXS\pawno\include\sscanf2.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Sa-MP\RXS\RXS\pawno\include\sscanf2.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level

D:\RTD\RTD\RSU\gamemodes\RST.pwn(1458) : warning 219: local variable "string" shadows a variable at a preceding level

D:\RTD\RTD\RSU\gamemodes\RST.pwn(4105) : warning 225: unreachable code

D:\RTD\RTD\RSU\gamemodes\RST.pwn(6943) : warning 219: local variable "string" shadows a variable at a preceding level

D:\RTD\RTD\RSU\gamemodes\RST.pwn(6956) : warning 219: local variable "string" shadows a variable at a preceding level

D:\RTD\RTD\RSU\gamemodes\RST.pwn(6964) : warning 219: local variable "string" shadows a variable at a preceding level

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7446) : error 001: expected token: ")", but found "&"

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7446) : error 001: expected token: ";", but found "&"

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7448) : error 010: invalid function or declaration

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7451) : error 010: invalid function or declaration

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7456) : error 010: invalid function or declaration

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7457) : error 010: invalid function or declaration

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7459) : error 010: invalid function or declaration

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7467) : error 010: invalid function or declaration

D:\RTD\RTD\RSU\gamemodes\RST.pwn(7469) : error 010: invalid function or declaration

D:\RTD\RTD\RSU\gamemodes\RST.pwn(10233) : warning 219: local variable "string" shadows a variable at a preceding level

D:\RTD\RTD\RSU\gamemodes\RST.pwn(11783) : warning 203: symbol is never used: "string"

D:\RTD\RTD\RSU\gamemodes\RST.pwn(11783) : warning 203: symbol is never used: "var"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

9 Errors.[/pawn]

Posted

Trebuie sa fie in genu asta!

[pawn]CMD:giveallcash ( playerid , params [ ] )

{

if ( PlayerInfo [ playerid ] [ Level ] >= 5 || IsPlayerAdmin ( playerid ) )

{

    new cash;

    if ( sscanf ( params , "d" , cash ) )

    {

    SendClientMessage ( playerid , red , "{FF0000}Foloseste /giveallcash [ suma ]" ) ;

    SendClientMessage ( playerid , red , "{FF0000}ATENTIE!:{AD8693}Nu da o suma exagerat de mare" ) ;

    }

    else

    {

    for ( new i = 0;i <MAX_PLAYERS;i++ )

    {

GivePlayerMoney ( i , cash ) ;

new str [ 150 ];

            format ( str , 150 , "{B3B3B3}Administratorul {FF0000}%s {B3B3B3}a dat tuturor playerilor o suma de {FF0000}%d $" , GetName ( playerid ) , cash ) ;

            SendClientMessage ( i , red , str ) ;

    }

}

}

else

{

    SendClientMessage ( playerid , red , "{B3B3B3}Trebuie sa fii macar admin level 5 pentru a folosi aceasta comanda" ) ;

}

return 1;

}[/pawn]

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.