CMD:givedrugs(playerid, params[])
{
if(gTeam[playerid] == DRUG)
{
new id, drug[100], ammount;
if(sscanf(params,"us[100]i",id,drug,ammount)) return SendClientMessage(playerid, -1, "USAGE: /givedrugs <id/name> <drugname> <grams> - drug names: weed & heroin");
if GetPlayerWeed(playerid) < ammount) return SendClientMessage(playerid, -1, "You do not have that much grams!");
if(drug == weed) { GivePlayerWeed(id, ammount); }
if(drug == heroin) { GivePlayerHeroin(id, ammount); }
return 1;
}
else if(gTeam[playerid] != DRUG)
{
SendClientMessage(playerid, -1, "You are not a drug dealer");
return 1;
}
return 1;
}
CMD:givedrugs(playerid, params[])
{
if(gTeam[playerid] == DRUG)
{
new id, drug[100], ammount;
if(sscanf(params,"us[100]i",id,drug,ammount)) return SendClientMessage(playerid, -1, "USAGE: /givedrugs <id/name> <drugname> <grams> - drug names: weed & heroin");
if GetPlayerWeed(playerid) < ammount) return SendClientMessage(playerid, -1, "You do not have that much grams!");
if(!strcmp(drug, "weed", true)) { GivePlayerWeed(id, ammount); }
if(!strcmp(drug, "heroin", true)) { GivePlayerHeroin(id, ammount); }
return 1;
}
else if(gTeam[playerid] != DRUG)
{
SendClientMessage(playerid, -1, "You are not a drug dealer");
return 1;
}
return 1;
}
drugname == weed
drugname == "weed" // This doesn't work either, fyi
C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : error 001: expected token: "*then", but found ")" C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : error 029: invalid expression, assumed zero C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : warning 215: expression has no effect C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : error 001: expected token: ";", but found "return" C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
if GetPlayerWeed(playerid) < ammount) return SendClientMessage(playerid, -1, "You do not have that much grams!");
Sorry ive just woken up and not thinking good yet
![]() Код:
C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : error 001: expected token: "*then", but found ")" C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : error 029: invalid expression, assumed zero C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : warning 215: expression has no effect C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : error 001: expected token: ";", but found "return" C:\Users\iphone\Desktop\Pawn Scripting\gamemodes\Sfcnr.pwn(2435) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
if GetPlayerWeed(playerid) < ammount) *then SendClientMessage(playerid, -1, "You do not have that much grams!");
if(GetPlayerWeed(playerid) < ammount) return SendClientMessage(playerid, -1, "You do not have that much grams!");