20.06.2008, 13:31
hei guys..i did this
this is for sending drugs.... it will send 1 gram for 10$....
and this is for using them
now...how to do /givedrugs to give drugs..instead of money..i tried GivePlayerDrugs.. i tried to define..to do "new GivePlayerDrugs" .. i want to make it...and is not working..how to make him give drugs instead of money?

the /smoke i will do it with GetPlayerDrugs
or how to do it?pls help
the errors :
Код:
dcmd_givedrugs(playerid, params[])
{
new
giveplayerid,
amount;
if (sscanf(params, "dd", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /givedrugs [playerid] ");
else if (!IsPlayerConnected(giveplayerid)) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
{
GivePlayerMoney(giveplayerid, 1);
GivePlayerMoney(playerid, 0 - 10);
SendClientMessage(playerid, 0x00FF00AA, "Drugs sent");
SendClientMessage(giveplayerid, 0x00FF00AA, "Money recieved");
}
return 1;
}
and this is for using them
Код:
if(strcmp(cmdtext, "/smoke", true)==0)
{
if (GetPlayerMoney(playerid) < +1) {
SendClientMessage(playerid, COLOR_RED, "SERVER MESSAGE: You dont have any drugs ");
return 1;
} else {
SendClientMessage(playerid,COLOR_LIGHTBLUE,"SERVER MESSAGE: You smoked drugs and you are high now!");
}
SetPlayerHealth(playerid,100);
return 1;
}

the /smoke i will do it with GetPlayerDrugs
or how to do it?pls help

the errors :
Код:
C:\Documents and Settings\MC RYder\Desktop\tec9 scripts\Tec9 Summer Project Server\gamemodes\tec9.pwn(92) : warning 219: local variable "giveplayerid" shadows a variable at a preceding level C:\Documents and Settings\MC RYder\Desktop\tec9 scripts\Tec9 Summer Project Server\gamemodes\tec9.pwn(422) : warning 219: local variable "pname" shadows a variable at a preceding level C:\Documents and Settings\MC RYder\Desktop\tec9 scripts\Tec9 Summer Project Server\gamemodes\tec9.pwn(580) : error 029: invalid expression, assumed zero C:\Documents and Settings\MC RYder\Desktop\tec9 scripts\Tec9 Summer Project Server\gamemodes\tec9.pwn(580) : warning 215: expression has no effect C:\Documents and Settings\MC RYder\Desktop\tec9 scripts\Tec9 Summer Project Server\gamemodes\tec9.pwn(580) : error 001: expected token: ";", but found ")" C:\Documents and Settings\MC RYder\Desktop\tec9 scripts\Tec9 Summer Project Server\gamemodes\tec9.pwn(580) : error 029: invalid expression, assumed zero C:\Documents and Settings\MC RYder\Desktop\tec9 scripts\Tec9 Summer Project Server\gamemodes\tec9.pwn(580) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.

