D:\data aji\Samp server\gamemodes\Adjie.pwn(452) : warning 219: local variable "id" shadows a variable at a preceding level D:\data aji\Samp server\gamemodes\Adjie.pwn(456) : warning 213: tag mismatch D:\data aji\Samp server\gamemodes\Adjie.pwn(452) : warning 204: symbol is assigned a value that is never used: "id" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Warnings.
CMD:chouse(playerid, params[])
{
new tmp[256];
tmp = strtok(params,Index);
new tmp2[256];
tmp2 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid,-1,"Use: /chouse [price] [intid]");
new id = strval(tmp2);
new Price = strval(tmp);
if(Price <= 0)
return SendClientMessage(playerid,-1,"Invalid house price. The house price must be between $"#MIN_HOUSE_PRICE" and $"#MAX_HOUSE_PRICE"");
CreateHouse(playerid,GetFreeHouseID(),Price,id);
SendClientMessage(playerid,-1,"House Created");
return 1;
}
CMD:chouse(playerid, params[])
{
new Price[128];
new ID[128];
if(sscanf(params,"ii",Price,ID) return SendClientMessage(playerid,-1,"Use: /chouse [price] [intid]");
if(Price <= 0) return SendClientMessage(playerid,-1,"Invalid house price. The house price must be between $"#MIN_HOUSE_PRICE" and $"#MAX_HOUSE_PRICE"");
CreateHouse(playerid,GetFreeHouseID(),Price,ID);
SendClientMessage(playerid,-1,"House Created");
return 1;
}
|
Try using sscanf,
PHP код:
|
D:\data aji\Samp server\gamemodes\Adjie.pwn(450) : error 001: expected token: ")", but found "return" D:\data aji\Samp server\gamemodes\Adjie.pwn(451) : error 033: array must be indexed (variable "Price") D:\data aji\Samp server\gamemodes\Adjie.pwn(452) : error 035: argument type mismatch (argument 3) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
|
and i got this
Код:
D:\data aji\Samp server\gamemodes\Adjie.pwn(450) : error 001: expected token: ")", but found "return" D:\data aji\Samp server\gamemodes\Adjie.pwn(451) : error 033: array must be indexed (variable "Price") D:\data aji\Samp server\gamemodes\Adjie.pwn(452) : error 035: argument type mismatch (argument 3) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors. |
CMD:chouse(playerid, params[])
{
new Price[128];
new ID[128];
if(sscanf(params,"ii",Price,ID)) return SendClientMessage(playerid,-1,"Use: /chouse [price] [intid]");
if(Price <= 0) return SendClientMessage(playerid,-1,"Invalid house price. The house price must be between $"#MIN_HOUSE_PRICE" and $"#MAX_HOUSE_PRICE"");
CreateHouse(playerid,GetFreeHouseID(),Price,ID);
SendClientMessage(playerid,-1,"House Created");
return 1;
}
|
Should be like this
PHP код:
|
D:\data aji\Samp server\gamemodes\Adjie.pwn(451) : error 033: array must be indexed (variable "Price") D:\data aji\Samp server\gamemodes\Adjie.pwn(452) : error 035: argument type mismatch (argument 3) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
CMD:chouse(playerid, params[])
{
new Price;
new ID;
if(sscanf(params,"ii",Price,ID)) return SendClientMessage(playerid,-1,"Use: /chouse [price] [intid]");
if(Price <= 0) return SendClientMessage(playerid,-1,"Invalid house price. The house price must be between $"#MIN_HOUSE_PRICE" and $"#MAX_HOUSE_PRICE"");
CreateHouse(playerid,GetFreeHouseID,Price,ID);
SendClientMessage(playerid,-1,"House Created");
return 1;
}
if(Price <= 0) return SendClientMessage(playerid,-1,"Invalid house price. The house price must be between $X and $X");
CMD:chouse(playerid, params[])
{
new Price[128];
new ID[128];
if(sscanf(params,"ii",Price,ID) return SendClientMessage(playerid,-1,"Use: /chouse [price] [intid]");
CreateHouse(playerid,GetFreeHouseID(),Price,ID);
SendClientMessage(playerid,-1,"House Created");
return 1;
}