Jump to content

Recommended Posts

Posted (edited)

Salut, lucrez la gamemode ul meu de la zero si sunt mai incepator si am incercat sa fac comanda /stats

asta e codu:

function ShowStats(playerid,targetid) {
    if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetid)) return true;
	new
		string[500],
		atext[20],
		ttext[180],
		rtext[180],
		jtext[100],
		drank[20],
		vtext[20],
		infostring2[600],
		playersip[180],
		radios[64],
		infostring[600],
	
		Money = PlayerInfo[targetid][pMoney],
		Admin = PlayerInfo[targetid][pAdmin],
		Owner = PlayerInfo[targetid][pOwner],
		Vip = PlayerInfo[targetid][pVip],
		Reborn = PlayerInfo[targetid][pReborn],
		PremiumAccount = PlayerInfo[targetid][pPremiumAccount],
		FreshPoints = PlayerInfo[targetid][pFreshPoints],
		PremiumPoints = PlayerInfo[targetid][pPremiumPoints],

	format(string, sizeof(string), "%s[%d], Playing hours: %.2f, Money: $%s | Bank: $%s | Phone: %d (%d credit)", GetNameEx(targetid), targetid,PlayerInfo[targetid][pConnectTime], warn, GetCashStr(targetid), GetBankMoney(targetid), pnumber, PlayerInfo[targetid][pCredit]);
	SCM(playerid, COLOR_WHITE,string);
	format(string, sizeof(string), "Level: %d, Respect Points: %d/%d | Premium Account: %s | Vip Account: %s | Premium Points: %s",level,exp,expamount,FormatNumber(costlevel),drank,vtext, FormatNumber(PlayerInfo[targetid][pPremiumPoints]));
	SCM(playerid, COLOR_WHITE,string);	
	//}					
	format(infostring2, strlen(infostring)-1, "%s", infostring);
	SCM(playerid, COLOR_WHITE, infostring2);
	return true;
}

si imi da eroarea:

C:\pawno\include\sscanf2.inc(342) : warning 219: local variable "string" shadows a variable at a preceding level
C:\pawno\include\sscanf2.inc(402) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(447) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(627) : error 010: invalid function or declaration
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(628) : error 010: invalid function or declaration
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(651) : error 021: symbol already defined: "format"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(656) : error 021: symbol already defined: "format"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(658) : error 010: invalid function or declaration
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(778) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(826) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(643) : warning 203: symbol is never used: "Admin"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(648) : warning 203: symbol is never used: "FreshPoints"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(642) : warning 203: symbol is never used: "Money"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(644) : warning 203: symbol is never used: "Owner"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(647) : warning 203: symbol is never used: "PremiumAccount"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(649) : warning 203: symbol is never used: "PremiumPoints"
Pawn compiler 3.10.8	 	 	Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(646) : warning 203: symbol is never used: "Reborn"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(645) : warning 203: symbol is never used: "Vip"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(631) : warning 203: symbol is never used: "atext"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(635) : warning 203: symbol is never used: "drank"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(640) : warning 203: symbol is never used: "infostring"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(637) : warning 203: symbol is never used: "infostring2"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(634) : warning 203: symbol is never used: "jtext"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(638) : warning 203: symbol is never used: "playersip"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(639) : warning 203: symbol is never used: "radios"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(633) : warning 203: symbol is never used: "rtext"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(630) : warning 203: symbol is never used: "string"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(632) : warning 203: symbol is never used: "ttext"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(636) : warning 203: symbol is never used: "vtext"
[Finished in 0.4s with exit code 1]
[cmd: ['pawncc.exe', '-i includes', 'C:\\Users\\dariu\\OneDrive\\Desktop\\fresh gm\\gamemodes\\gm.pwn', '-;+']]
[dir: C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes]
[path: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\dariu\AppData\Local\Microsoft\WindowsApps;]

 am incercat sa fac aceasta functie de pe alte gm uri dar nu reusesc sa ii dau de cap

enum pInfo {
	pLevel,        
	pAdmin,
	pOwner,
	pPremiumAccount,
	pReborn,
	pVip,
	pMoney,
	pChar,
	pAW,
	pPremiumPoints,
	pFreshPoints,
};

asta e enumurile pe care le vreau in stats

Help a newbie

Edited by ImDariusHere
Posted

Inlocuieste 

PremiumPoints = PlayerInfo[targetid][pPremiumPoints],

cu

PremiumPoints = PlayerInfo[targetid][pPremiumPoints];

Ai uitat sa inchizi aici si probabil de aici sunt erorile, revino cu mesaj daca ai alte erori.

Apropo, incearca sa miscorezi string-urile, samp-ul nu iti pertmite sa scrii 500 caractere pe un rand.

Posted

Si vezi ca tu nu folosesti nicaieri PremiumPoints, FreshPoints, vei avea niste warning-uri pe tema asta si defineste warn ca vei avea erori.

Posted (edited)
C:\pawno\include\sscanf2.inc(342) : warning 219: local variable "string" shadows a variable at a preceding level
C:\pawno\include\sscanf2.inc(402) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(448) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(628) : error 010: invalid function or declaration
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(629) : error 010: invalid function or declaration
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(649) : error 010: invalid function or declaration
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(652) : error 021: symbol already defined: "format"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(657) : error 021: symbol already defined: "format"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(659) : error 010: invalid function or declaration
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(779) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(827) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(644) : warning 203: symbol is never used: "Admin"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(643) : warning 203: symbol is never used: "Money"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(645) : warning 203: symbol is never used: "Owner"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(648) : warning 203: symbol is never used: "PremiumAccount"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(647) : warning 203: symbol is never used: "Reborn"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(646) : warning 203: symbol is never used: "Vip"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(632) : warning 203: symbol is never used: "atext"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(636) : warning 203: symbol is never used: "drank"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(641) : warning 203: symbol is never used: "infostring"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(638) : warning 203: symbol is never used: "infostring2"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(635) : warning 203: symbol is never used: "jtext"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(639) : warning 203: symbol is never used: "playersip"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(640) : warning 203: symbol is never used: "radios"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(634) : warning 203: symbol is never used: "rtext"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(631) : warning 203: symbol is never used: "string"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(633) : warning 203: symbol is never used: "ttext"
C:\Users\dariu\OneDrive\Desktop\fresh gm\gamemodes\gm.pwn(637) : warning 203: symbol is never used: "vtext"
Pawn compiler 3.10.8	 	 	Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
[Finished in 0.4s]

nu stiu ce zici tu acolo sa micsorez string urile dar am inlocuit alea

Edited by ImDariusHere
Posted
16 minutes ago, MihaiT11 said:

Si vezi ca tu nu folosesti nicaieri PremiumPoints, FreshPoints, vei avea niste warning-uri pe tema asta si defineste warn ca vei avea erori.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.