10.01.2014, 14:18
I got problem with my 2 textdraws : engine and stats here's the code :
Commands : cengine, stats
Errors :
PS : The Lights work perfect and the rest ... total shit
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid != INVALID_TEXT_DRAW)
{
if(clickedid == TDMenu2) // Show Stats
{
return cmd_stats(playerid, params[]);
}
else if(clickedid == TDMenu4) // Turn On Car Engine
{
return cmd_cengine(playerid, params[]);
}
else if(clickedid == TDMenu5) // Turn On Car Lights
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
SetVehicleLights(vehicleid, playerid);
//return cmd_clights;
}
// Hide the game menu after he clicked what he needed.
TextDrawHideForPlayer(playerid, TDMenu2);
TextDrawHideForPlayer(playerid, TDMenu4);
TextDrawHideForPlayer(playerid, TDMenu5);
CancelSelectTextDraw(playerid);
}
return 1;
}
Код:
CMD:gamemenu(playerid,params[])
{
TextDrawShowForPlayer(playerid, TDMenu2);//STATS
TextDrawShowForPlayer(playerid, TDMenu5);//ENGINE
TextDrawShowForPlayer(playerid, TDMenu4);//LIGHTS
SelectTextDraw(playerid, 0xAFAFAFAA);
return 1;
}
Код:
CMD:cengine(playerid, params[])
{
new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
new string[128];
vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_ON)
{
SetVehicleEngine(vehicleid, playerid);
}
else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
{
SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
new rand = random(4);
if(rand == 0)
{
SetTimerEx("SetVehicleEngine", 1000, 0, "dd", vehicleid, playerid);
SendClientMessage(playerid, COLOR_TWYELLOW, "Vehicle engine started");
format(string, sizeof(string), "* %s has started his vehicle's engine", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(rand == 1)
{
SendClientMessage(playerid, COLOR_TWYELLOW, "Vehicle engine failed to start");
format(string, sizeof(string), "* %s struggles to start the engine but fails", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(rand == 2)
{
SetTimerEx("SetVehicleEngine", 1000, 0, "dd", vehicleid, playerid);
SendClientMessage(playerid, COLOR_TWYELLOW, "Vehicle engine started");
format(string, sizeof(string), "* %s has started his vehicle's engine", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(rand == 3)
{
SetTimerEx("SetVehicleEngine", 1000, 0, "dd", vehicleid, playerid);
SendClientMessage(playerid, COLOR_TWYELLOW, "Vehicle engine started");
format(string, sizeof(string), "* %s has started his vehicle's engine", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}
-- Stats --
CMD:stats(playerid, params[]) {
if (gPlayerLogged{playerid} != 0) {
ShowStats(playerid,playerid);
}
return 1;
}
Код:
F:\Servers\Samp\Razer Gaming Roleplay\gamemodes\RZRP.pwn(32023) : error 017: undefined symbol "params" F:\Servers\Samp\Razer Gaming Roleplay\gamemodes\RZRP.pwn(32027) : error 017: undefined symbol "params" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.

