Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Coldplay poslato Jul 02, 2012, 16:28:06 POSLE PODNE

Naslov: [Pomoc] Hitno ako moze!
Poruka od: Coldplay poslato Jul 02, 2012, 16:28:06 POSLE PODNE
Skripta koju koristim: ZBRPG
Detaljan opis problema:
Imam veliki problem... Naime ako igrace kupe zatvore, nemogu nista u njega stavljati, jer pise da nisu u celiji... Koji je razlog problemu?
Dio skripte:
Evo skripte od /celldeposit
COMMAND:celldeposit(playerid, params[])
{
new str[128], quantity, option[6];
    if(PlayerStat[playerid][HasCell] == 0) return SendClientMessage(playerid, GREY, "You don't own a cell.");
    if(sscanf(params,"s[6]d", option, quantity)) return SendClientMessage(playerid, GREY, "USAGE: /celldeposit [pot/crack] [quantity]");
else if(!strcmp(option, "pot", true))
{
    if(!IsPlayerInCell(playerid)) return SendClientMessage(playerid, GREY, "You must be inside your cell.");
    if(PlayerStat[playerid][Pot] < quantity) return SendClientMessage(playerid, GREY, "You don't have that much.");
    if(CellStat[PlayerStat[playerid][Cell]][CellLevel] == 1)
    {
if(0 < quantity <= 5)
{
                if(CellStat[PlayerStat[playerid][Cell]][CellPot] + quantity > 5) return SendClientMessage(playerid, GREY, "Your cell level is 1 so you can't have more than 5grams of pot in your cell.");
PlayerStat[playerid][Pot] -= quantity;
CellStat[PlayerStat[playerid][Cell]][CellPot] += quantity;
format(str, sizeof(str), "%s takes out something and hides it somewhere in the cell.", GetICName(playerid));
    SendNearByMessage(playerid, ACTION_COLOR, str, 3);
format(str, sizeof(str), "You have successfully deposited %d grams of pot inside your cell.", quantity);
SendClientMessage(playerid, GREEN, str);
SaveCell(PlayerStat[playerid][Cell]);
}
else return SendClientMessage(playerid, GREY, "Your cell level is 1 so you can't deposit more than 5grams of pot.");
}
if(CellStat[PlayerStat[playerid][Cell]][CellLevel] == 2 || CellStat[PlayerStat[playerid][Cell]][CellLevel] == 3)
    {
if(0 < quantity <= 10)
{
                if(CellStat[PlayerStat[playerid][Cell]][CellPot] + quantity > 10) return SendClientMessage(playerid, GREY, "Your cell level is 2 or 3 so you can't have more than 10grams of pot in your cell.");
PlayerStat[playerid][Pot] -= quantity;
CellStat[PlayerStat[playerid][Cell]][CellPot] += quantity;
format(str, sizeof(str), "%s takes out something and hides it somewhere in the cell.", GetICName(playerid));
    SendNearByMessage(playerid, ACTION_COLOR, str, 3);
format(str, sizeof(str), "You have successfully deposited %d grams of pot inside your cell.", quantity);
SendClientMessage(playerid, GREEN, str);
SaveCell(PlayerStat[playerid][Cell]);
}
else return SendClientMessage(playerid, GREY, "Your cell level is 2 or 3 so you can't deposit more than 10grams of pot.");
}
}
else if(!strcmp(option, "crack", true))
{
    if(!IsPlayerInCell(playerid)) return SendClientMessage(playerid, GREY, "You must be inside your cell.");
    if(PlayerStat[playerid][Crack] < quantity) return SendClientMessage(playerid, GREY, "You don't have that much.");
    if(CellStat[PlayerStat[playerid][Cell]][CellLevel] == 1)
    {
if(0 < quantity <= 4)
{
                if(CellStat[PlayerStat[playerid][Cell]][CellCrack] + quantity > 4) return SendClientMessage(playerid, GREY, "Your cell level is 1 so you can't have more than 4grams of crack in your cell.");
PlayerStat[playerid][Crack] -= quantity;
CellStat[PlayerStat[playerid][Cell]][CellCrack] += quantity;
format(str, sizeof(str), "%s takes out something and hides it somewhere in the cell.", GetICName(playerid));
    SendNearByMessage(playerid, ACTION_COLOR, str, 3);
format(str, sizeof(str), "You have successfully deposited %d grams of crack inside your cell.", quantity);
SendClientMessage(playerid, GREEN, str);
SaveCell(PlayerStat[playerid][Cell]);
}
else return SendClientMessage(playerid, GREY, "Your cell level is 1 so you can't deposit more than 4grams of crack.");
}
if(CellStat[PlayerStat[playerid][Cell]][CellLevel] == 2 || CellStat[PlayerStat[playerid][Cell]][CellLevel] == 3)
    {
if(0 < quantity <= 8)
{
if(CellStat[PlayerStat[playerid][Cell]][CellCrack] + quantity > 8) return SendClientMessage(playerid, GREY, "Your cell level is 2 or 3 so you can't have more than 8grams of crack in your cell.");
PlayerStat[playerid][Crack] -= quantity;
CellStat[PlayerStat[playerid][Cell]][CellCrack] += quantity;
format(str, sizeof(str), "%s takes out something and hides it somewhere in the cell.", GetICName(playerid));
    SendNearByMessage(playerid, ACTION_COLOR, str, 3);
format(str, sizeof(str), "You have successfully deposited %d grams of crack inside your cell.", quantity);
SendClientMessage(playerid, GREEN, str);
SaveCell(PlayerStat[playerid][Cell]);
}
else return SendClientMessage(playerid, GREY, "Your cell level is 2 or 3 so you can't deposit more than 8grams of crack in your cell.");
}
}
else return SendClientMessage(playerid, GREY, "Invalid option.");
    return 1;
}


Evo od Stock

stock IsPlayerInCell(playerid)
{
if(IsPlayerConnected(playerid) && PlayerStat[playerid][HasCell] == 1 && GetPlayerVirtualWorld(playerid) == CellStat[PlayerStat[playerid][Cell]][VW])
{
if(IsPlayerInRangeOfPoint(playerid,10.0,CellStat[PlayerStat[playerid][Cell]][InteriorX],CellStat[PlayerStat[playerid][Cell]][InteriorY],CellStat[PlayerStat[playerid][Cell]][InteriorZ]))
{
    return 1;
  }
}
return 0;
}

Ako treba jos nesto recite!
Neke slike/video za lakse dobivanje pomoci(neobavezno): Kada stvorim celiju, onda ga porta tocno za +1.7... Ako ista pomaze...