20.04.2014, 18:03
I have make two filterscript: one for registration_system and other for weed_system..
Now i have put a stats command in registration_system.
this is the stats command
this is the FS weed system, i have include in it, the FS registration system like you can see in this code.
when the player plant a seed the variable pinfo[playerid][seeds] decrement of --*2 and when it pick weed, the variable pinfo[playerid][weed] increment of ++*2..
but when i send stats command the voices [Weed]:, [Seeds]: , still unchanged. why ?
Now i have put a stats command in registration_system.
this is the stats command
pawn Код:
CMD:stats(playerid,params[])
{
new stringa[129],nome[MAX_PLAYER_NAME];
GetPlayerName(playerid,nome,sizeof(nome));
format(stringa,sizeof(stringa),"••• %s's stats •••",nome);
SendClientMessage(playerid,-1,stringa);
format(stringa,sizeof(stringa),"[viplevel]:%i, [Money]:%i, [Score]:%i, [Kills]:%i, [Deaths]:%i, [Weed]:%i, [Seeds]: %i, [Ratio]:%0.2f",pinfo[playerid][viplevel],GetPlayerMoney(playerid),pinfo[playerid][score],pinfo[playerid][kills],pinfo[playerid][deaths],pinfo[playerid][weed],pinfo[playerid][seeds],floatdiv(pinfo[playerid][kills],pinfo[playerid][deaths]));
SendClientMessage(playerid,-1,stringa);
return 1;
}
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#include "registration_system.pwn"
#define MAX_WEED 1000
#define MAX_WEED_PER_PLAYER 3
#define LIBRARY "BOMBER"
#define ANIMATION "BOM_Plant_Crouch_In"
enum piantainfo
{
Float:poswx,
Float:poswy,
Float:poswz,
Text3D:labelweed
}
new winfo[MAX_WEED][piantainfo];
new mariaobject[MAX_WEED];
new contopiante;
CMD:plantseed(playerid,params[])
{
if(pinfo[playerid][seeds] < 5) return SendClientMessage(playerid,-1,"[SERVER]You havn't sufficient seeds for plant");
new id = contopiante;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
winfo[id][poswx] = x;
winfo[id][poswy] = y;
winfo[id][poswz] = z;
winfo[id][labelweed] = Create3DTextLabel("On Harvest..",0xFF0000FF,winfo[id][poswx],winfo[id][poswy],winfo[id][poswz],3.5,GetPlayerVirtualWorld(playerid));
mariaobject[id] = CreateObject(3409,x,y,z-1,0.0,0.0,0.0,100);
ApplyAnimation(playerid,LIBRARY,ANIMATION,4.1,0,0,0,0,3000,1);
contopiante++;
pinfo[playerid][seeds]--*2;
return 1;
}
CMD:pickweed(playerid,params[])
{
for(new i = 0; i < MAX_WEED; i++)
{
if(!IsPlayerInRangeOfPoint(playerid,3.0,winfo[i][poswx],winfo[i][poswy],winfo[i][poswz])) continue;
DestroyObject(mariaobject[i]);
Delete3DTextLabel(winfo[i][labelweed]);
contopiante--;
pinfo[playerid][weed]++*2;
}
return 1;
}
but when i send stats command the voices [Weed]:, [Seeds]: , still unchanged. why ?