Command isn't working - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command isn't working (
/showthread.php?tid=319208)
Command isn't working -
SumX - 18.02.2012
Hello,what's wrong here? i don't have any errors,but ingame,the commands aren't working. Thank you!
Код:
if (strcmp(cmd, "/jestertune", true) == 0)
{
if (PlayerInfo[playerid][pVIP] == 1)
{
if(!IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000FF, "You must be the driver to use this command.");
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 559) // Jester
{
AddVehicleComponent(vehicleid, 1010);
AddVehicleComponent(vehicleid, 1074);
AddVehicleComponent(vehicleid, 1087);
AddVehicleComponent(vehicleid, 1066);
AddVehicleComponent(vehicleid, 1068);
AddVehicleComponent(vehicleid, 1158);
AddVehicleComponent(vehicleid, 1159);
AddVehicleComponent(vehicleid, 1160);
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 2);
}
SendClientMessage(playerid, 0xFF0000FF, "You have tuned a Jester.");
return 1;
}
}
}
}
return 1;
}
Код:
if( strcmp( cmdtext, "/vhelp", true ) == 0 )
{
if( IsPlayerConnected( playerid ) )
{
if (PlayerInfo[playerid][pVIP] == 1)return SendClientMessage(playerid, red, "You must have a V.I.P. Account to use this command! ");
{
new vhelp[256];
strcat( vhelp, "{FFD700}/vhelp\t\t\t{FFD700}/vrespawn\n" );
strcat( vhelp, "{FFD700}/vips\t\t\t{FFD700}/vgoto\n" );
strcat( vhelp, "{FFD700}/vnos\t\t\t{FFD700}/vgethere\n" );
strcat( vhelp, "{FFD700}/sultantune\t\t{FFD700}/vweapons\n" );
strcat( vhelp, "{FFD700}/jestertune\t\t{FFD700}/vammo\n" );
strcat( vhelp, "{FFD700}/elegytune\t\t{FFD700}/vclub\n" );
strcat( vhelp, "{FFD700}/othertune\n" );
strcat( vhelp, "{FFD700}Use '/vc' in front of text.This is the V.I.P. chat." );
ShowPlayerDialog( playerid, VIPCMDS, DIALOG_STYLE_MSGBOX, "V.I.P. Commands:", string, "Quit", "" );
}
}
return 1;
}
Re : Command isn't working -
ricardo178 - 18.02.2012
Make the ifes return messages if they return 0, so you know if the script is stopping in any of them.
Re: Command isn't working -
SumX - 18.02.2012
so...like this?
Код:
if (PlayerInfo[playerid][pVIP] == 1)return SendClientMessage(playerid, red, "You must have a V.I.P. Account to use this command! ");