21.07.2016, 07:51
(
Последний раз редактировалось MayaEU; 21.07.2016 в 08:43.
)
Well when i type /cooler, it will not show the name of the fish, only the beginning letter
of the last stored fish. Example, if the last fish i catch is a tuna, it will show "t" in the cooler
I really hope thay anyone can help me rep+
And this is an example, when the cooler is full, that is four diffrent fishes

The command
of the last stored fish. Example, if the last fish i catch is a tuna, it will show "t" in the cooler
I really hope thay anyone can help me rep+
And this is an example, when the cooler is full, that is four diffrent fishes

The command
pawn Код:
if(strcmp(cmd,"/cooler",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCooler] == 0)
return SendClientMessage(playerid, 0xAFAFAFAA, "You don't have a cooler! Buy one at 24/7.");
new coolerslots;
if(PlayerInfo[playerid][pCooler] == 1)
{
coolerslots = 5;
}
tmp = strtok(cmdtext,idx);
if(strlen(tmp))
{
if(strcmp(tmp,"take",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(strlen(tmp))
{
new slot = strval(tmp);
if(slot >= 1 && slot <= coolerslots)
{
switch(pCoolerType[playerid][slot])
{
case 1:
{
format(string, sizeof(string), "* %s takes a %s from his cooler.", MaskOnOff(playerid),pCoolerValue[playerid][slot]);
ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
Fishes[playerid][pFish] = pCoolerValue[playerid][slot];
pCoolerType[playerid][slot] = 0;
pCoolerValue[playerid][slot] = 0;
return 1;
}
default:
{
SendClientMessage(playerid,COLOR_GREY,"There's no fish there for you to take!");
return 1;
}
}
}
}
format(string,sizeof(string),""COL_SZR"Usage:"COL_WHITE" /cooler take <1-5>");
SendClientMessage(playerid,COLOR_GREY,string);
return 1;
}
else if(strcmp(tmp,"store",true) == 0)
{
new emptyslot;
for(new i = 1;i <= coolerslots;i++)
{
if(pCoolerType[playerid][i] == 0)
{
emptyslot = i;
break;
}
}
if(!emptyslot)
{
return SendClientMessage(playerid,COLOR_GREY," Your cooler is full!");
}
if(Fishes[playerid][pFish] == 0)
return SendClientMessage(playerid, COLOR_GREY, "You don't have a fish to put in your cooler!");
tmp = strtok(cmdtext,idx);
pCoolerType[playerid][emptyslot] = 1;
pCoolerValue[playerid][emptyslot] = Fishes[playerid][pFish];
format(string, sizeof(string), "* %s puts a %s in his cooler.", MaskOnOff(playerid),Fishes[playerid][pFish]);
ProxDetector(30.0, playerid, string, COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
return 1;
}
}
SendClientMessage(playerid, 0xAFAFAFAA, "Your Styrofoam cooler contains:");
for(new i = 1;i <= coolerslots;i++)
{
switch(pCoolerType[playerid][i])
{
case 1: { format(string,sizeof(string),"%d. %s",i,pCoolerValue[playerid][i]); }
case 2: { format(string,sizeof(string),"%d. %s)",i,pCoolerValue[playerid][i]); }
case 3: { format(string,sizeof(string),"%d. %s)",i,pCoolerValue[playerid][i]); }
case 4: { format(string,sizeof(string),"%d. %s)",i,pCoolerValue[playerid][i]); }
case 5: { format(string,sizeof(string),"%d. %s)",i,pCoolerValue[playerid][i]); }
default: { format(string,sizeof(string),"%d. None",i); }
}
SendClientMessage(playerid,COLOR_GREY,string);
}
SendClientMessage(playerid, 0xAFAFAFAA, ""COL_SZR"Usage:"COL_WHITE" /cooler <store|take>");
return 1;
}
return 1;
}