Jump to content
  • 0

Problema Setplevel


Invizion

Question

Nick: Invizion

Problema: nu functioneaza comanda o scriu si nu-mi apare nimic..

Erori / warnings: nu

Lini/script:

Comanda

[pawn]

dcmd_setplevel(playerid, params[])//Set a player level

{

new amount;

if(!sscanf(params, "dd", giveplayerid, amount)) return SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /setplevel [PlayerID] [pLevel]");

SetPlayerLevel(giveplayerid, amount);

return 1;

}

[/pawn]

stock

[pawn]SetPlayerLevel(playerid, plevel)

{

    PlayerInfo[playerid][pLevel] = plevel;

    dini_IntSet(PFile(playerid), "pLevel", PlayerInfo[playerid][pLevel]);

}[/pawn]

Ai incercat sa rezolvi singur ?: Da

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

Pai prin "nu-mi apare nimic" cred ca te referi ca nu-ti apare nimic in chat . Trebuie sa adaugi SendClientMessage-uri ca sa-ti apara in chat .

http://wiki.sa-mp.com/wiki/SendClientMessage

De curiozitate sa nu spui ca vorbesc prosti adauga la functia SetPlayerLevel :

SendClientMessage(playerid,-1,".ANdy47. a avut dreptate");

Link to comment
Share on other sites

dcmd_setplevel(playerid, params[])//Set a player level
{
	new amount;
	if(sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /setplevel [PlayerID] [pLevel]");
	SetPlayerLevel(giveplayerid, amount);
	return 1;
}

In fata la sscanf tu aveai "!" si nu trebuia sa fie acolo si tu la parametri sscanf aveai "dd" "d" inseamna un numar deci nu puteai sa dai /setplevel .ANdy47. 23 . Parametrul "u" este folosit pentru UserName/ID .

Link to comment
Share on other sites

[pawn]C:\Users\Invizion\Desktop\Romania Dark Drift v2\pawno\include\Sinclude.inc(133) : warning 219: local variable "amount" shadows a variable at a preceding level

C:\Users\Invizion\Desktop\Romania Dark Drift v2\pawno\include\Sinclude.inc(151) : warning 219: local variable "amount" shadows a variable at a preceding level

C:\Users\Invizion\Desktop\Romania Dark Drift v2\gamemodes\RDD.pwn(4977) : error 035: argument type mismatch (argument 2)

C:\Users\Invizion\Desktop\Romania Dark Drift v2\gamemodes\RDD.pwn(57083) : error 001: expected token: ")", but found "&"

C:\Users\Invizion\Desktop\Romania Dark Drift v2\gamemodes\RDD.pwn(57083) : error 029: invalid expression, assumed zero

C:\Users\Invizion\Desktop\Romania Dark Drift v2\gamemodes\RDD.pwn(57083) : error 010: invalid function or declaration

C:\Users\Invizion\Desktop\Romania Dark Drift v2\gamemodes\RDD.pwn(57083 -- 57086) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

5 Errors.[/pawn]

?

Link to comment
Share on other sites

Acel "[" apare de la forum cand scri "[]" poftim puneo asta :

dcmd_setplevel(playerid, params[])//Set a player level
{
    new amount;
    if(sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /setplevel [PlayerID] [pLevel]");
    SetPlayerLevel(giveplayerid, amount);
    return 1;
}

Link to comment
Share on other sites

Încearcă aşa:

dcmd_setplevel(playerid, params[ ])//Set a player level

{

    new Playa, iAmount;

    if( sscanf( params, "ud", Playa, iAmount ) ) return SendClientMessage( playerid, 0xFF0000AA, "{FF0000}[ERROR]{FFFFFF}Usage: /setplevel [PlayerID] [Level]" );

    PlayerInfo[Playa][pLevel] = iAmount;

    dini_IntSet( PFile( Playa ), "pLevel", PlayerInfo[ Playa ][ pLevel ] );

    return 1;

}

I'm back bitches.

Link to comment
Share on other sites

Topic Inchis , fara reply in ultimele 48 ore.

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.