Drug system help
#1

hei guys..i did this

Код:
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;
}
this is for sending drugs.... it will send 1 gram for 10$....

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;
}
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 :
Код:
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.
Reply
#2

1.- What is at line 580
2.- You have "pname" many times
3.- What is "GivePlayerMoney(playerid, 0 - 10);"
4.- What is "if (GetPlayerMoney(playerid) < +1)"... Only "if(GetPlayerMoney(playerid) < 1)" xP
Reply
#3

i worked again at it
Код:
f(strcmp(cmdtext,"/givedrugs",true) == 0) {
GivePlayerMoney(giveplayerid, 1);
		GivePlayerMoney(playerid, 0 - 10);
		SendClientMessage(playerid, 0x00FF00AA, "Drugs sent");
		SendClientMessage(giveplayerid, 0x00FF00AA, "Money recieved");
	return 1;
}
if(strcmp(cmdtext, "/smoke", true)==0)
{
if (GetPlayerMoney(playerid) > 0) {
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;
}
now it compiles good..
i might need to make it so he gives drugs instead of money..
Reply
#4

what gamemode do you use?
Godfather?

ok if you use godfather here it is

http://pastebin.com/f4b2d9503

i think this should do the job
Reply
#5

I dont use godfather!i use my own..and btw can u plz reply here? http://forum.sa-mp.com/index.php?topic=64577.0
thanks
Reply
#6

http://forum.sa-mp.com/index.php?top...msg1071206#new
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)