30.07.2011, 12:21
Hello.
I'm trying to make a trunk system. I made that you can open trunk with /trunk open, but now I want to make /trunk store armour [amount of armour]. How can i make that 3'nd word? Armour saving ill do my selft, just need help with how to make armour [amount of armour]
Sorry for poor english.
I'm trying to make a trunk system. I made that you can open trunk with /trunk open, but now I want to make /trunk store armour [amount of armour]. How can i make that 3'nd word? Armour saving ill do my selft, just need help with how to make armour [amount of armour]
Sorry for poor english.
pawn Код:
new idx, tmp[128], cmd[128];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/trunk", true) == 0)
{
if(gPlayerHasCar[playerid] == 0) return SendClientMessage(playerid, -1, ""#COL_RED"[error]: "#COL_WHITE"u dont have vehicle keys");
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, -1, ""#COL_GREY"[usage]: "#COL_WHITE"/trunk open / close / store / take");
return 1;
}
if(strcmp(x_nr, "open", true) == 0)
{
if(TrunkOpen[Vehicle[playerid]] == 1) return SendClientMessage(playerid, -1, ""#COL_RED"[error]: "#COL_WHITE"trunk is already opened");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(Vehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(Vehicle[playerid], engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
TrunkOpen[Vehicle[playerid]] = 1;
return 1;
}
if(strcmp(x_nr, "store", true) == 0)
{
if(TrunkOpen[Vehicle[playerid]] == 0) { SendClientMessage(playerid, -1, ""#COL_RED"[error]: "#COL_WHITE"open trunk first"); return 1; };
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, -1, ""#COL_GREY"[usage]: "#COL_WHITE"/trunk store armour amount of armour / weapon ... .. . .. . ."); return 1; }
return 1;
}
// /trunk open works well, but how to make /trunk store armour [amount of armour]
// Here is little code for armour storing
new Float:plyArmour;
GetPlayerArmour(playerid, plyArmour);
if(plyArmour != 0)
{
SetPlayerArmour(playerid, 0);
vehTrunkArmour[result] = plyArmour;
format(string, sizeof(string), "* %s takes off his/her body armour and puts it into car trunk.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
}
return 1;
}