PHP Code:
#define DIALOG_COOKIE 1
Dialogs starts their ID at (0) just like any other ID formatted function.
PHP Code:
enum CookieInfo
{
Cookies,
RLevel
}
new cInfo[MAX_PLAYERS][CookieInfo];
Seems useless to me to use an enum for 2 variables, could've just done this.
PHP Code:
new cInfo[MAX_PLAYERS][2];
PHP Code:
stock Path(playerid)
{
new str[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),UserPath,name);
return str;
}
Why is this a
stock, better yet, why is it a function?
PHP Code:
stock GetName(playerid)
{
new name[24];
GetPlayerName(playerid,name,24);
return name;
}
Again, why is it a
stock? Plus, this and the other function above serves no intentional usage, pure lazyness.
PHP Code:
stock NotAuthorized(playerid)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command.");
}
This makes no sense to be a
stock, or even a function.. Like why..
PHP Code:
stock PlayerName(playerid)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
return pname;
}
You already declared one "GetPlayerName" function, clearly you've copy pasted this.
PHP Code:
SetPlayerHealth(playerid, 99.00);
and
SetPlayerArmour(playerid, 99.00);
Why 99.0 and not 100.0?
PHP Code:
GivePlayerWeapon(playerid, 34, 100);
GivePlayerWeapon(playerid, 29, 300);
GivePlayerWeapon(playerid, 31, 200);
You should learn to use MACROs from start, I.E:
WEAPON_BRASSKNUCKLE
PHP Code:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateVehicle(522, X+4, Y, Z, 82.2873, -1, -1, 60);
You're setting the vehicle's position 4 units->east. This makes the vehicle in risk of being spawned inside of an object.
You're also setting the angle to 82.2-.. Why not use GetPlayerFacing Angle?
Also, last but not least, you're not checking whether the player is in a virtual world, interior or w/e.
(look up PutPlayerInVehicle as well)
PHP Code:
CMD:rewarderhelp(playerid,params[])
{
if(cInfo[playerid][RLevel] == 1)
{
SendClientMessage(playerid, COLOR_LB,"Junior Rewarder : /givecookie - /givecookieall - /rewardrehelp");
}
if(cInfo[playerid][RLevel] == 2)
{
SendClientMessage(playerid, COLOR_LB,"Junior Rewarder : /givecookie - /giveallcookie - /rewardrehelp");
SendClientMessage(playerid, COLOR_LB,"General Rewarder : /setcookies");
}
if(cInfo[playerid][RLevel] == 3 || (IsPlayerAdmin(playerid)))
{
SendClientMessage(playerid, COLOR_LB,"Junior Rewarder : /givecookie - /givecookieall - /rewardrehelp");
SendClientMessage(playerid, COLOR_LB,"General Rewarder : /setcookies");
SendClientMessage(playerid, COLOR_LB,"Head Rewarder : /makerewarder");
}
else
{
NotAuthorized(playerid);
}
return 1;
}
Look up switch() for better optimization and stylish design.
PHP Code:
if(level > 3 || level < 0)
Can be replaced with
PHP Code:
if(0 < level > 3)
PHP Code:
if (level == 0) return SendClientMessage(targetid, COLOR_LB,"You have beeen fired from your position as a rewarder");
if (level == 1) return SendClientMessage(targetid, COLOR_LB,"You have been set as a Junior Rewarder");
if (level == 2) return SendClientMessage(targetid, COLOR_LB,"You have been set as a General Rewarder");
if (level == 3) return SendClientMessage(targetid, COLOR_LB,"You have been set as a Head Rewarder");
Again, use switch()
Code is not well-looking at all, try fixing it and making the filterscript
useful(being the keyword here) and release it again.