One error, grabweed. +1 rep -
Lynet - 13.04.2013
PHP код:
CMD:grabweed(playerid, params[])
{
if(PInfo[playerid][Drugs] < 1) return SendClientMessage(playerid, COLOR_BROWN, "You are not an supplier rank 1.");
SendClientMessage(playerid, COLOR_GREY, "You are not at the druglab.");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 302.6837,300.7080,999.1484,4.5756))
{
PInfo[playerid] +=20;
SendClientMessage(playerid, COLOR_RED, "You cutted a 20gram of weed as you pocket it.");
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: /checkweed for check how many grams you have left.");
return 1;
}
return 1;
}
the error:
PHP код:
error 023: array assignment must be simple assignment
Re : One error, grabweed. +1 rep -
DaTa[X] - 13.04.2013
Try this
pawn Код:
CMD:grabweed(playerid, params[])
{
if(PInfo[playerid][Drugs] < 1) return SendClientMessage(playerid, COLOR_BROWN, "You are not an supplier rank 1.");
SendClientMessage(playerid, COLOR_GREY, "You are not at the druglab.");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 302.6837,300.7080,999.1484))
{
PInfo[playerid][Drugs] +=20;
SendClientMessage(playerid, COLOR_RED, "You cutted a 20gram of weed as you pocket it.");
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: /checkweed for check how many grams you have left.");
return 1;
}
return 1;
}
EDITED
Re: One error, grabweed. +1 rep -
Isolated - 13.04.2013
change to
pawn Код:
PInfo[playerid][Drugs] +=20;
Also everytime someone types your command, it'll display a message, even if they are at the druglab.
Re: One error, grabweed. +1 rep -
[XST]O_x - 13.04.2013
You are missing something here. It should be PInfo[playerid][SOMETHING] += 20;
Re: One error, grabweed. +1 rep -
Lynet - 13.04.2013
Same :/
Re: One error, grabweed. +1 rep -
JJB562 - 13.04.2013
Like everyone else said you must add another array to
So it would be like:
pawn Код:
PInfo[playerid][SOMETHING] += 20;
Anyways, I edited your code so it can work better:
pawn Код:
CMD:grabweed(playerid, params[])
{
if(PInfo[playerid][Drugs] < 1) return SendClientMessage(playerid, COLOR_BROWN, "You are not an supplier rank 1.");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 302.6837,300.7080,999.1484,4.5756))
{
PInfo[playerid][SOMETHING] +=20;
SendClientMessage(playerid, COLOR_RED, "You cutted a 20gram of weed as you pocket it.");
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: /checkweed for check how many grams you have left.");
}
else SendClientMessage(playerid, COLOR_GREY, "You are not at the druglab.");
return 1;
}
Re: One error, grabweed. +1 rep -
XStormiest - 13.04.2013
pawn Код:
CMD:grabweed(playerid, params[])
{
if(PInfo[playerid][Drugs] < 1) return SendClientMessage(playerid, COLOR_BROWN, "You are not an supplier rank 1.");
if(IsPlayerInRangeOfPoint(playerid, 3.0, 302.6837,300.7080,999.1484,4.5756))
{
PInfo[playerid][Drugs] +=20;
SendClientMessage(playerid, COLOR_RED, "You cutted a 20gram of weed as you pocket it.");
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: /checkweed for check how many grams you have left.");
}
else SendClientMessage(playerid, COLOR_GREY, "You are not at the druglab.");
return 1;
}
this is the code