CMD:agiveweed(playerid, params[])
{
new targetid, string[128], amount;
if(PlayerStat[playerid] [AdminLevel] < 2) return SendClientMessage(playerid, GREY, "You don't have access to this command!");
if(sscanf(params, "ud[128]", targetid, amount)) return SendClientMessage(playerid, GREY, "USAGE: /agiveweed [playerid] [amount]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, "That player is not connected!");
{
Weed[targetid] = amount;
format(string, sizeof(string), "You have given %s weed!", GetOOCName(targetid));
SendClientMessage(playerid, WHITE, string);
format(string, sizeof(string), "Administrator %s has given you weed!", GetOOCName(playerid));
SendClientMessage(targetid, WHITE, string);
AdminActionLog(string);
}
return 1;
}
GetPlayerWeed(playerid, amount)
{
new amount;
if(Weed[playerid] = amount; // need to fix
return amount
}
CMD:smokeweed(playerid, params[])
{
new string[128], amount;
if(Weed [playerid] == 0) return SendClientMessage(playerid, WHITE, "You do not have any weed seeds!");
if(Weed [playerid] == 1)
{
ApplyAnimation(playerid, "JST_BUISNESS", "smoke_01", 4.1, 1, 1, 1, 0, 1, 1);
new Float:health;
GetPlayerHealth(playerid, health);
//if(health > 60) return SendClientMessage(playerid, WHITE, "You cannot smoke weed if your health is 60 or above!");
SetPlayerHealth(playerid, health+25);
GetPlayerWeed(playerid, amount);
format(string, sizeof(string), "%s takes out a joint and smokes some weed.", GetOOCName(playerid));
SendNearByMessage(playerid, ACTION_COLOR, string, 4);
}
return 1;
}
new Weed[MAX_PLAYERS];
// and
Weed[playerid] = 0;
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(414) : warning 219: local variable "amount" shadows a variable at a preceding level
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(415) : warning 211: possibly unintended assignment
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(415) : error 001: expected token: ")", but found ";"
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(415) : error 036: empty statement
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(417) : error 001: expected token: ";", but found "}"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
GetPlayerWeed(playerid, amount)
{
new amount;
if(Weed[playerid] = amount; // need to fix
return amount;
}
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(414) : warning 219: local variable "amount" shadows a variable at a preceding level
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(415) : warning 211: possibly unintended assignment
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(415) : error 001: expected token: ")", but found ";"
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(415) : error 036: empty statement
C:\Users\cbrickell\Desktop\PWN\gamemodes\EGRP.pwn(412) : warning 203: symbol is never used: "amount"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
GetPlayerWeed(playerid, amount)
{
Weed[playerid] = amount;
return 1;
}
pawn Код:
|
GetPlayerWeed(playerid) return Weed[playerid];
GetPlayerWeed(playerid) return Weed[playerid];
CMD:smokeweed(playerid, params[])
{
new string[128];
if(GetPlayerWeed(playerid) == 0) return SendClientMessage(playerid, WHITE, "You do not have any weed seeds!");
if(GetPlayerWeed(playerid) >= 1)
{
ApplyAnimation(playerid, "JST_BUISNESS", "smoke_01", 4.1, 1, 1, 1, 0, 1, 1);
new Float:health;
GetPlayerHealth(playerid, health);
//if(health > 60) return SendClientMessage(playerid, WHITE, "You cannot smoke weed if your health is 60 or above!");
SetPlayerHealth(playerid, health+25);
format(string, sizeof(string), "%s takes out a joint and smokes some weed.", GetOOCName(playerid));
SendNearByMessage(playerid, ACTION_COLOR, string, 4);
}
return 1;
}
pawn Код:
|
pawn Код:
|
GetPlayerWeed(playerid, amount)
{
new amount;
if(Weed[playerid] = amount; // need to fix
return amount;
}