08.01.2012, 07:51
Well, I want a player to be able to save a weapon, but when I try to save it, I get the command saved instead of the weapon ID.
This is the code:
This is the code:
pawn Код:
if (strcmp("store", option, true, 4) == 0){
new option2[50], number, Float:Armor;
if(sscanf(params, "s[30]s[30]", option, option2)) return SendClientMessage(playerid, COLOR_USAGE, "[USAGE:] /trunk store weapon | armor | money.");
if (strcmp("weapon", option2, true, 4) == 0){
if(GetPlayerScore(playerid) == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You need to be level 2 or above to use this.");
if(GetPlayerWeapon(playerid) == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You are not holding a weapon.");
new str[80], weapname[20];
vInfo[vid][TrunkWeapon1] = GetPlayerWeapon(playerid);
print(vInfo[vid][TrunkWeapon1]);
format(str, sizeof(str), "stores %s in the trunk of the vehicle", GetWeaponName(vInfo[vid][TrunkWeapon1], weapname, sizeof(weapname)));
return PlayerActionMsg(playerid, str);
}
}