/car spawner? -
Tomix - 10.08.2013
Hello if someone can help me out please?
I keep on getting this error when compiling:car.pwn(23) : warning 203: symbol is never used: "car"
Код:
#include <a_samp>
CMD:car(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 6) {
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
if(isnull(tmp)) return SendClientMessage(playerid, red, "USAGE: /car [Modelid/Name] [colour1] [colour2]");
new car, colour1, colour2, string[128];
if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
if(car < 400 || car > 611) return SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
if(isnull(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);
new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid);
LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1); PutPlayerInVehicle(playerid, LVehicleID, 0);
PlayerInfo[playerid][pCar] = LVehicleID;
CMDMessageToAdmins(playerid,"CAR");
format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
SaveToFile("CarSpawns",string);
format(string, sizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
return SendClientMessage(playerid,lightblue, string);
} else return SendClientMessage(playerid,red,"ERROR: You need to be level 6 to use this command");
}
Im trying to make a filterscript someone please help me.
Re: /car spawner? -
PrinceKumar - 10.08.2013
include zcmd & also put zcmd.inc into pawno include
Re: /car spawner? -
PT - 10.08.2013
is more simple if you use sscanf
Re: /car spawner? -
BullseyeHawk - 10.08.2013
pawn Код:
CMD:car(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 6)
{
new tmp[128], tmp2[128], tmp3[128], Index; tmp = strtok(params, Index); tmp2 = strtok(params, Index); tmp3 = strtok(params, Index);
if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /car [Modelid/Name] [colour1] [colour2]");
new carmodel, colour1, colour2;
if(!IsNumberic(tmp)) { carmodel = GetVehicleModelIDFromName(tmp); } else { carmodel = strval(tmp); }
if(!strlen(tmp2)) { colour1 = random(126); } else { colour1 = strval(tmp2); }
if(!strlen(tmp3)) { colour2 = random(126); } else { coloru2 = strval(tmp3); }
if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid)) { CarDeleter(PlayerInfo[playerid][pCar]); }
new Float:X, Float:Y, Float:Z, Float:A, int1; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); int1 = GetPlayerInterior(playerid);
LVehicleID = CreateVehicle(carmodel, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1); PutPlayerInVehicle(playerid, LVehicleID, 0);
PlayerInfo[playerid][pCar] = LVehicleID;
CMDMessageToAdmins(playerid,"CAR");
format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[carmodel-400], carmodel, colour1, colour2, X, Y, Z);
SaveToFile("CarSpawns",string);
format(string, sizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)", VehicleNames[carmodel-400], carmodel, colour1, colour2);
return SendClientMessage(playerid,lightblue, string);
} else return SendClientMessage(playerid, red, "ERROR: You need to be level 6 to use this command");
}
I think it's a small name problem, try this please and tell me if it's the same.
Edit: Oh yeah, like past said. Include zcmd or y_commands..
Re: /car spawner? -
Smokeyy - 10.08.2013
add car = strval(tmp)
Re: /car spawner? -
Tomix - 10.08.2013
I have included zcmd and now Im getting the following errors:
car.pwn(5) : error 017: undefined symbol "PlayerInfo"
car.pwn(5) : warning 215: expression has no effect
filterscripts\car.pwn(5) : error 001: expected token: ";", but found "]"
car.pwn(5) : error 029: invalid expression, assumed zero
car.pwn(5) : fatal error 107: too many error messages on one line
Re: /car spawner? -
Tomix - 10.08.2013
Any help with that please?
Re: /car spawner? -
BullseyeHawk - 10.08.2013
You need a PlayerInfo system..
pawn Код:
enum pInfo
{
... //code here
}
new PlayerInfo[MAX_PLAYERS][pInfo];