21.11.2009, 22:48
thanks for the help on it, i got 2 warnings im not to sure if it makes a huge diffrence as i have never worked with dcmd before mind doing a quick lookover?
pawn Код:
C:\Documents and Settings\Mark\Desktop\SA-MP .3a Server\gamemodes\desertwindbase.pwn(58) : warning 213: tag mismatch
C:\Documents and Settings\Mark\Desktop\SA-MP .3a Server\gamemodes\desertwindbase.pwn(50) : warning 203: symbol is never used: "params"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
pawn Код:
dcmd_cargotruck(playerid,params[]) // warning
{
for(new i;i<MAX_VEHICLES;i++)
{
if(GetVehicleModel(i) == 433 || GetVehicleModel(i) == 455)
{
new Float:x,Float:y,Float:z;
GetVehiclePos(i,x,y,z);
if(IsPlayerInRangeOfPoint(playerid,10.0, x,y,z)==true) // warning
{
SendClientMessage(playerid,COLOR_GREEN,"Ammo Refilled!");
// ammo stuff
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"A cargo truck isn't close enought for you to refill ammo!");
return 1;
}
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/ref", true) == 0 || strcmp(cmd, "/refill", true) == 0)
{
if(IsPlayerConnected(playerid))
{
dcmd(cargotruck,10,cmdtext);
return 1;
}
}
return 0;