PDA

View Full Version : CMD problem?


N0FeaR
22/06/2012, 10:48 AM
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(22) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(22) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(22) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(22) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(45) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(45) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(45) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(45) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(69) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(69) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(69) : warning 202: number of arguments does not match definition
C:\Users\Hellman\Desktop\New folder\pawno\include\/CRP/Commands/drugs.pwn(69) : warning 202: number of arguments does not match definition





COMMAND:drugs(playerid, params[])
{
new usage[128], type[128], targetid, amount, string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
if(sscanf(params, "s[128]S(none)[128]U(999)I(0)", usage, type, targetid, amount)) SendClientMessage(playerid, COLOR_GREEN, "USAGE: /drugs [use/give/plant/pick/combine]");
else
{
if(strcmp(usage, "use", true) == 0) if(strcmp(type, "none", true) == 0) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /drugs [use] [cocaine/ecstasy/weed]");
if(strcmp(usage, "give", true) == 0) if(targetid == 999 || amount == 0) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /drugs [give] [cocaine/ecstasy/weed] [playerid] [amount]");
if(strcmp(usage, "use", true) == 0)
{
if(PlayerInfo[playerid][pDrugTime] > 0) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You need to wait because you are already high.");
if(strcmp(type, "cocaine", true) == 0)
{
if(PlayerInfo[playerid][pCocaine] > 0)
{
new Float:PlayersHealth;
GetPlayerHealth(playerid, PlayersHealth);
SetPlayerHealthEx(playerid, PlayersHealth + 10.0);
format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes out some cocaine from %s pocket and snorts it up %s nose.", sendername, CheckSex(playerid) , CheckSex(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE);
GameTextForPlayer(playerid, "~w~Cocaine~n~~p~Used", 4000, 1);
PlayerInfo[playerid][pCocaine]--;
format(string, sizeof(string), "INFO: Cocaine used leaving you with %d grams left.", PlayerInfo[playerid][pCocaine]);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playerid][pDrugTime] = 200;
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have any Cocaine grams left.");
}
}
else if(strcmp(type, "ecstasy", true) == 0)
{
if(PlayerInfo[playerid][pEcstasy] > 0)
{
new Float:PlayersArmour;
GetPlayerArmour(playerid, PlayersArmour);
SetPlayerArmourEx(playerid, PlayersArmour+ 20.0);
format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes out a small pipe and lights the end of it smoking ecstasy.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE);
GameTextForPlayer(playerid, "~w~ecstasy~n~~p~Used", 4000, 1);
PlayerInfo[playerid][pEcstasy]--;
format(string, sizeof(string), "INFO: ecstasy used leaving you with %d grams left.", PlayerInfo[playerid][pEcstasy]);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playerid][pDrugTime] = 300;
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have any ecstasy grams left.");
}
}
else if(strcmp(type, "weed", true) == 0)
{
if(PlayerInfo[playerid][pWeed] > 0)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMO KE_CIGGY);
new Float:PlayersHealth;
GetPlayerHealth(playerid, PlayersHealth);
SetPlayerHealthEx(playerid, PlayersHealth + 10.0);
format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes a rolled blunt from %s pocket and starts to smoke it.", sendername, CheckSex(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE);
GameTextForPlayer(playerid, "~w~Weed~n~~p~Used", 4000, 1);
PlayerInfo[playerid][pWeed]--;
format(string, sizeof(string), "INFO: Weed used leaving you with %d grams left.", PlayerInfo[playerid][pWeed]);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playerid][pDrugTime] = 100;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have any Weed grams left.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: I dont know that drug type.");
}
}
else if(strcmp(usage, "give", true) == 0)
{
if(targetid == 999 || amount == 0) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /drugs [give] [cocaine/ecstasy/weed] [playerid] [amount]");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You cannot give yourself drugs.");
if(amount < 1 || amount > 1000) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 1 or above 1000.");
if(IsPlayerConnected(targetid))
{
if(strcmp(type, "cocaine", true) == 0)
{
if(amount > PlayerInfo[playerid][pCocaine]) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have that much cocaine on you.");
if(PlayerInfo[playerid][pCocaine] > 0)
{
if(PlayerToPlayer(playerid,targetid,3.0))
{
if(DrugLimit(targetid,amount,3))
{
format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
format(giveplayer, sizeof(giveplayer), "%s", PlayerNameEx(targetid));
GiveNameSpace(sendername);
GiveNameSpace(giveplayer);
GiveNameSpace(giveplayer);
format(string, sizeof(string), "INFO: You gave %s %d grams of Cocaine.", giveplayer, amount);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string) ;
format(string, sizeof(string), "INFO: %s gave you %d grams of Cocaine.", sendername, amount);
SendClientMessage(targetid,COLOR_LIGHTBLUE,string) ;
PlayerInfo[playerid][pCocaine]-=amount;
PlayerInfo[targetid][pCocaine]+=amount;
}
else
{
format(string, sizeof(string), "INFO: The player cannot hold that much cocaine grams, can only hold %d more grams.", DrugLimitLeft(targetid,3));
SendClientMessage(playerid,COLOR_GREY,string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You are not close to that player.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have any Cocaine grams left.");
}
}
else if(strcmp(type, "ecstasy", true) == 0)
{
if(amount > PlayerInfo[playerid][pEcstasy]) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have that much ecstasy on you.");
if(PlayerInfo[playerid][pEcstasy] > 0)
{
if(PlayerToPlayer(playerid,targetid,3.0))
{
if(DrugLimit(targetid,amount,2))
{
format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
format(giveplayer, sizeof(giveplayer), "%s", PlayerNameEx(targetid));
GiveNameSpace(sendername);
GiveNameSpace(giveplayer);
format(string, sizeof(string), "INFO: You gave %s %d grams of ecstasy.", giveplayer, amount);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string) ;
format(string, sizeof(string), "INFO: %s gave you %d grams of ecstasy.", sendername, amount);
SendClientMessage(targetid,COLOR_LIGHTBLUE,string) ;
PlayerInfo[playerid][pEcstasy]-=amount;
PlayerInfo[targetid][pEcstasy]+=amount;
}
else
{
format(string, sizeof(string), "INFO: The player cannot hold that much ecstasy grams, can only hold %d more grams.", DrugLimitLeft(targetid,2));
SendClientMessage(playerid,COLOR_GREY,string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You are not close to that player.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have any ecstasy grams left.");
}
}
else if(strcmp(type, "weed", true) == 0)
{
if(amount > PlayerInfo[playerid][pWeed]) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have that much Weed on you.");
if(PlayerInfo[playerid][pWeed] > 0)
{
if(PlayerToPlayer(playerid,targetid,3.0))
{
if(DrugLimit(targetid,amount,1))
{
format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
format(giveplayer, sizeof(giveplayer), "%s", PlayerNameEx(targetid));
GiveNameSpace(sendername);
GiveNameSpace(giveplayer);
format(string, sizeof(string), "INFO: You gave %s %d grams of Weed.", giveplayer, amount);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string) ;
format(string, sizeof(string), "INFO: %s gave you %d grams of Weed.", sendername, amount);
SendClientMessage(targetid,COLOR_LIGHTBLUE,string) ;
PlayerInfo[playerid][pWeed]-=amount;
PlayerInfo[targetid][pWeed]+=amount;
}
else
{
format(string, sizeof(string), "INFO: The player cannot hold that much weed grams, can only hold %d more grams.", DrugLimitLeft(targetid,1));
SendClientMessage(playerid,COLOR_GREY,string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You are not close to that player.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: You dont have any Weed grams left.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "SERVER: I dont know that drug type.");
}
}
}
else if(strcmp(usage, "plant", true) == 0)
{
if(PlayerInfo[playerid][pSeeds] == 0) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You do not have any Seeds.");
if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be on foot to use this.");
if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be outside to use this.");
for(new weed = 0; weed < sizeof(WeedInfo); weed++)
{
if(WeedInfo[weed][wPlanted] == 0 && WeedInfo[weed][wTime] == 0)
{
new Float:x,Float:y,Float:z;
PlayerInfo[playerid][pSeeds] = 0;
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
GetPlayerPos(playerid, x, y, z);
WeedInfo[weed][wObject] = CreateDynamicObject(3409, x, y, z-2.0, 0, 0, 0, 0);
WeedInfo[weed][wX] = x;
WeedInfo[weed][wY] = y;
WeedInfo[weed][wZ] = z;
WeedInfo[weed][wTime] = 60;
WeedInfo[weed][wPlanted] = 1;
SendClientMessage(playerid,COLOR_GREEN,"INFO: You have planted your weed plant and it will grow in one hour, use /drugs pick to pick it up.");
return 1;
}
}
}
else if(strcmp(usage, "pick", true) == 0)
{
if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You must be on foot to use this.");
for(new weed = 0; weed < sizeof(WeedInfo); weed++)
{
if(IsPlayerInRangeOfPoint(playerid,2.0,WeedInfo[weed][wX],WeedInfo[weed][wY],WeedInfo[weed][wZ]))
{
if(WeedInfo[weed][wPlanted] == 1 && WeedInfo[weed][wX] != 0.0 && WeedInfo[weed][wY] != 0.0 && WeedInfo[weed][wZ] != 0.0)
{
if (WeedInfo[weed][wTime] >= 0) return SendClientMessage(playerid, COLOR_YELLOW, "INFO: This plant is not ready to be picked yet.");
if (DrugLimit(playerid,30,1))
{
format(string, sizeof(string), "INFO: You cannot hold this amount of weed grams in your hand, can only hold %d more grams.", DrugLimitLeft(playerid,1));
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
DestroyDynamicObject(WeedInfo[weed][wObject]);
PlayerInfo[playerid][pWeed] += 30;
WeedInfo[weed][wX] = 0.0;
WeedInfo[weed][wY] = 0.0;
WeedInfo[weed][wZ] = 0.0;
WeedInfo[weed][wPlanted] = 0;
SendClientMessage(playerid,COLOR_GREEN,"INFO: You have picked up this plant and gained 30 grams of weed.");
return 1;
}
}
}
}
else if(strcmp(usage, "combine", true) == 0)
{
if(PlayerInfo[playerid][pCocaine] < 2) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You need over 2 grams of cocaine to combine them.");
ShowPlayerDialog(playerid,7,DIALOG_STYLE_MSGBOX,"Information","Press the 'OK' Button to combine 2 grams of cocaine to 1 gram of ecstasy.","Ok", "Cancel");
}
}
return 1;
}

Niko_boy
22/06/2012, 11:00 AM
highlight the lines please ...

N0FeaR
22/06/2012, 11:06 AM
highlight the lines please ...

To lazzy but one of them are this


ProxDetector(30.0, playerid, string, COLOR_PURPLE);