what's wrong?
#1

Quote:

if(GetPlayerScore(playerid) > 9999){
SetPlayerHealth(playerid, 100);}
else if(GetPlayerScore(playerid) > 19999){
SetPlayerHealth(playerid, 110);}
else if(GetPlayerScore(playerid) > 29999){
SetPlayerHealth(playerid, 115);}
else if(GetPlayerScore(playerid) > 39999){
SetPlayerHealth(playerid, 125);}
else if(GetPlayerScore(playerid) > 49999){
SetPlayerHealth(playerid, 130);}
else if(GetPlayerScore(playerid) > 99999){
SetPlayerHealth(playerid, 140);
SetPlayerArmour(playerid, 30};}
else if(GetPlayerScore(playerid) > 299999){
SetPlayerHealth(playerid, 145);
SetPlayerArmour(playerid, 60};}
else if(GetPlayerScore(playerid) > 499999){
SetPlayerHealth(playerid, 150);
SetPlayerArmour(playerid, 99};}

and i get 13errors. ( idk why.. :( ) when i delete it, - no errors.
Quote:

data/dutils.inc(28) : warning 219: local variable "string" shadows a variable at a preceding level
data/dutils.inc(132) : warning 219: local variable "string" shadows a variable at a preceding level
data/dutils.inc(172) : warning 219: local variable "string" shadows a variable at a preceding level
data/dutils.inc(280) : warning 219: local variable "string" shadows a variable at a preceding level
data/dutils.inc(337) : warning 219: local variable "string" shadows a variable at a preceding level
data/dutils.inc(379) : warning 219: local variable "string" shadows a variable at a preceding level
data/playerDB.txt(121) : warning 219: local variable "msg" shadows a variable at a preceding level
data/functions.txt(30) : warning 219: local variable "string" shadows a variable at a preceding level
data/functions.txt(223) : warning 219: local variable "file" shadows a variable at a preceding level
data/functions.txt(229) : warning 219: local variable "string" shadows a variable at a preceding level
data/functions.txt(274) : warning 219: local variable "msg" shadows a variable at a preceding level
data/functions.txt(295) : warning 219: local variable "string" shadows a variable at a preceding level
data/functions.txt(352) : warning 219: local variable "name" shadows a variable at a preceding level
data/houseDB.txt(120) : warning 219: local variable "file" shadows a variable at a preceding level
data/mobilus.txt(7) : warning 219: local variable "name" shadows a variable at a preceding level
data/mobilus.txt(29) : warning 219: local variable "msg" shadows a variable at a preceding level
data/mobilus.txt(42) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\paw no\include\audio.inc(130) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(616) : error 001: expected token: ",", but found "}"
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(616) : error 036: empty statement
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(617) : error 010: invalid function or declaration
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(620) : error 010: invalid function or declaration
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(640) : error 021: symbol already defined: "format"
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(642) : error 010: invalid function or declaration
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(645) : error 010: invalid function or declaration
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(647) : error 010: invalid function or declaration
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(652) : error 010: invalid function or declaration
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(655) : error 021: symbol already defined: "dini_IntSet"
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(655) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(655) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(655) : error 021: symbol already defined: "dini_IntSet"
C:\Documents and Settings\Admin\Desktop\Andriaus\Serveriai\rLKG\gam emodes\rLKG.pwn(655 -- 656) : fatal error 107: too many error messages on one line

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


13 Errors.

Reply
#2

pawn Код:
if(GetPlayerScore(playerid) > 9999){
SetPlayerHealth(playerid, 100);}
else if(GetPlayerScore(playerid) > 19999){
SetPlayerHealth(playerid, 110);}
else if(GetPlayerScore(playerid) > 29999){
SetPlayerHealth(playerid, 115);}
else if(GetPlayerScore(playerid) > 39999){
SetPlayerHealth(playerid, 125);}
else if(GetPlayerScore(playerid) > 49999){
SetPlayerHealth(playerid, 130);}
else if(GetPlayerScore(playerid) > 99999){
SetPlayerHealth(playerid, 140);
SetPlayerArmour(playerid, 30);}
else if(GetPlayerScore(playerid) > 299999){
SetPlayerHealth(playerid, 145);
SetPlayerArmour(playerid, 60);}
else if(GetPlayerScore(playerid) > 499999){
SetPlayerHealth(playerid, 150);
SetPlayerArmour(playerid, 99);}
Reply
#3

Thank you.
btw another question.
Quote:

if(!strcmp(cmdtext, "/duoti", true,6))
{
if(GetPlayerScore(playerid) < 4500){ SendClientMessage(playerid,RED2, "* Jus dar negalite duoti pinigu, jus nepakankamai patyres"); return 1;}
new tname[MAX_PLAYER_NAME];
strmid(tname,GetArgument(1, cmdtext, 0),0,MAX_PLAYER_NAME);
if(!strcmp(tname,"0",true)){SendClientMessage(play erid,RED2, "* Duoti pinigu: /duoti [dalis nicko] [kiek]"); return 1;}
new tid = GetPlayeridMid(tname);
GetPlayerName(tid,tname,sizeof(tname));
new tstring[256];
tstring = GetArgument(2, cmdtext, 0);
if(!IsNumeric(tstring)){SendClientMessage(playerid ,RED2, "* Duoti pinigu: /duoti [dalis nicko] [kiek (turi but skaicius)]"); return 1;}
if(GetPlayerScore(tid) < 4500){ SendClientMessage(playerid,RED2, "* Sis zaidejas dar nera patyres."); return 1;}
new moneys = StringToInt(tstring);
if(moneys == 0){SendClientMessage(playerid,RED2, "* Duoti pinigu: /duoti [dalis nicko] [kiek]"); return 1;}
if (tid == playerid){ SendClientMessage(playerid,RED2, "* Kam duoti pinigus sau?..."); return 1;}
if(GetPlayerMoneyA(playerid) < moneys){SendClientMessage(playerid,RED2, "* Tu neturi tiek!"); return 1;}
new Float:Coo[3];
GetPlayerPos(tid,Coo[0],Coo[1],Coo[2]);
if(!PlayerToPoint(30, playerid, Coo[0],Coo[1],Coo[2])){SendClientMessage(playerid,RED2, "* Zaidejas per toli!"); return 1;}
GivePlayerMoneyA(tid,moneys);
GivePlayerMoneyA(playerid,-moneys);
new mess[256],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(mess,sizeof(mess),"***[%s >> %i LT] Gavote %i LT is %s",name,moneys,moneys,name);
SendClientMessage(tid,COLOR_ORANGERED,mess);
format(mess,sizeof(mess),"***[%i LT >> %s] Davete %i LT %s",moneys,tname,moneys,tname);
SendClientMessage(playerid,COLOR_ORANGERED,mess);
return 1;
}

how can i do, that players cant use /duoti > 50000, t.y cost max 50000, at one time.
Reply
#4

Don't really get what you mean. If you mean that the max buy cost cant be more than $50,000, then:
pawn Код:
if(!strcmp(cmdtext, "/duoti", true,6))
{
if(GetPlayerScore(playerid) < 4500){ SendClientMessage(playerid,RED2, "* Jus dar negalite duoti pinigu, jus nepakankamai patyres"); return 1;}
new tname[MAX_PLAYER_NAME];
strmid(tname,GetArgument(1, cmdtext, 0),0,MAX_PLAYER_NAME);
if(!strcmp(tname,"0",true)){SendClientMessage(play erid,RED2, "* Duoti pinigu: /duoti [dalis nicko] [kiek]"); return 1;}
new tid = GetPlayeridMid(tname);
GetPlayerName(tid,tname,sizeof(tname));
new tstring[256];
tstring = GetArgument(2, cmdtext, 0);
if(!IsNumeric(tstring)){SendClientMessage(playerid ,RED2, "* Duoti pinigu: /duoti [dalis nicko] [kiek (turi but skaicius)]"); return 1;}
if(GetPlayerScore(tid) < 4500){ SendClientMessage(playerid,RED2, "* Sis zaidejas dar nera patyres."); return 1;}
new moneys = StringToInt(tstring);
if(moneys == 0){SendClientMessage(playerid,RED2, "* Duoti pinigu: /duoti [dalis nicko] [kiek]"); return 1;}
if(moneys > 50000){SendClientMessage(playerid,RED2, "* Your cost can't be more than $50,000."); return 1;}
if (tid == playerid){ SendClientMessage(playerid,RED2, "* Kam duoti pinigus sau?..."); return 1;}
if(GetPlayerMoneyA(playerid) < moneys){SendClientMessage(playerid,RED2, "* Tu neturi tiek!"); return 1;}
new Float:Coo[3];
GetPlayerPos(tid,Coo[0],Coo[1],Coo[2]);
if(!PlayerToPoint(30, playerid, Coo[0],Coo[1],Coo[2])){SendClientMessage(playerid,RED2, "* Zaidejas per toli!"); return 1;}
GivePlayerMoneyA(tid,moneys);
GivePlayerMoneyA(playerid,-moneys);
new mess[256],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(mess,sizeof(mess),"***[%s >> %i LT] Gavote %i LT is %s",name,moneys,moneys,name);
SendClientMessage(tid,COLOR_ORANGERED,mess);
format(mess,sizeof(mess),"***[%i LT >> %s] Davete %i LT %s",moneys,tname,moneys,tname);
SendClientMessage(playerid,COLOR_ORANGERED,mess);
return 1;
}
Reply
#5

ok thx, i will test it soon.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)