23.08.2012, 02:27
Tengo un error y un warning:
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\zc.pwn(41496) : warning 209: function "cmd_comprarhierba" should return a value C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\zc.pwn(41497) : error 010: invalid function or declaration
pawn Код:
CMD:comprarhierba(playerid, params[])
{
new string[128], amount;
if(sscanf(params, "d", amount)) return SendClientMessageEx(playerid, COLOR_WHITE, "USA: /comprarpot [amount]");
new tel;
new price;
new level = Info[playerid][pDrugsSkill];
if(level >= 0 && level <= 50)
{ tel = 100; if(amount < 1 || amount > 10) { SendClientMessageEx(playerid, COLOR_GREY, " No puedes sacar mas de 10 con este nivel de skill!"); return 1; } }
else if(level >= 51 && level <= 100)
{ tel = 100; if(amount < 1 || amount > 20) { SendClientMessageEx(playerid, COLOR_GREY, " No puedes sacar mas de 20 con este nivel de skill!"); return 1; } }
else if(level >= 101 && level <= 200)
{ tel = 100; if(amount < 1 || amount > 30) { SendClientMessageEx(playerid, COLOR_GREY, " No puedes sacar mas de 30 con este nivel de skill!"); return 1; } }
else if(level >= 201 && level <= 400)
{ tel = 100; if(amount < 1 || amount > 40) { SendClientMessageEx(playerid, COLOR_GREY, " No puedes sacar mas de 40 con este nivel de skill!"); return 1; } }
else if(level >= 401)
{ tel = 100; if(amount < 1 || amount > 50) { SendClientMessageEx(playerid, COLOR_GREY, " No puedes sacar mas de 50 con este nivel de skill!"); return 1; } }
new mypoint = -1;
for (new i=0; i<MAX_POINTS; i++)
{
if (IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && Points[i][Type] == 3)
{
mypoint = i;
}
}
if (mypoint == -1) return SendClientMessageEx(playerid, COLOR_GREY, " No estбs en la casa de crack!");
if ( Info[playerid][pPot] >= 25) return SendClientMessageEx(playerid, COLOR_GRAD2, " Tu ya tienes 25 gramos de hierba, no puedes cargar mбs.");
price = amount * tel;
if(Points[mypoint][Stock] < amount && Info[playerid][pVIP] < 1) return SendClientMessageEx(playerid, COLOR_GREY, " Esta casa de drogas no tiene mбs hierba!");
if(GetPlayerCash(playerid) > price) {
format(string, sizeof(string), "* Compraste %d gramos por $%d.", amount, price);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
GivePlayerCash(playerid, -price);
Info[playerid][pPot] += amount;
if(Info[playerid][pVIP] < 1) {
Points[mypoint][Stock] -= amount;
format(string, sizeof(string), " HIERBA DISPONIBLE: %d/1000.", Points[mypoint][Stock]);
UpdateDynamic3DTextLabelText(Points[mypoint][TextLabel], COLOR_YELLOW, string);
}
for(new i = 0; i < sizeof(fINFO); i++) {
if(strcmp(Points[mypoint][Owner], fINFO[i][FamilyName], true) == 0){
fINFO[i][FamilyBank] = fINFO[i][FamilyBank]+price/2;
}
}
}
else return SendClientMessageEx(playerid, COLOR_GREY, " No puedes pagar estas drogas!");
}//LНNEA 41496
return 1;//LНNEA 41497
}