One error, grabweed. +1 rep
#1

PHP код:
CMD:grabweed(playeridparams[])
{
    if(
PInfo[playerid][Drugs] < 1) return SendClientMessage(playeridCOLOR_BROWN"You are not an supplier rank 1.");
    
SendClientMessage(playeridCOLOR_GREY"You are not at the druglab.");
    if(
IsPlayerInRangeOfPoint(playerid3.0302.6837,300.7080,999.1484,4.5756))
    {
    
PInfo[playerid] +=20;
    
SendClientMessage(playeridCOLOR_RED"You cutted a 20gram of weed as you pocket it.");
    
SendClientMessage(playeridCOLOR_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 
Reply
#2

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
Reply
#3

pawn Код:
PInfo[playerid] +=20;
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.
Reply
#4

pawn Код:
PInfo[playerid] +=20;
You are missing something here. It should be PInfo[playerid][SOMETHING] += 20;
Reply
#5

Same :/
Reply
#6

Like everyone else said you must add another array to

pawn Код:
PInfo[playerid] += 20;
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;
}
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)