SA-MP Forums Archive
all my commands have been disabled. help? - 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: all my commands have been disabled. help? (/showthread.php?tid=337973)

Pages: 1 2


all my commands have been disabled. help? - xXitsgodzillaXx - 28.04.2012

okay for some reason all my commands with my GM arent working. i cant seem to figure out why tho. everything looks good to me. and i need help asap. people are wanting to play on my server. help i desperatly need to get this fixed!

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/911-police 187", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a Homicide at %s's location, Requesting EMS and Police for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 211", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a Robbery at %s's location, Requesting Police units for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 487", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have Grand theft Auto at %s's location, Requesting Police units for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 510", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a few Speeding or racing vehicles at %s's location, over.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/rdmtune", true) == 0)
{
    vehid = GetPlayerVehicleID(playerid);
    TuneVehicleRandomly(vehid);
    return 1;
}
    if (strcmp(cmdtext, "/radio", true) == 0)
{
    ShowPlayerDialog(playerid, radiodialog, DIALOG_STYLE_LIST, "Radio Stations", "Alternative\nClassic rock\nMetal\nTechno\nHiphop\nDubstep\nJazz\nReggae\nDancepunk\nAdultcomedy\nNewage\nFunk\nStopmusic", "Listen", "Cancel");
    return 1;
}
    if (strcmp(cmdtext, "/neon", true) == 0)
{
    if(IsPlayerInAnyVehicle(playerid))
{
    ShowPlayerDialog(playerid, neondialog, DIALOG_STYLE_LIST, "Neon Color", "DarkBlue\nRed\nGreen\nWhite\nViolet\nYellow\nCyan\nLightBlue\nPink\nOrange\nLightGreen\nLightYellow\nDelete Neon", "Select", "Cancel");
}
    return 1;
}
    if(strcmp("/fixveh", cmdtext, true) == 0)
{
    vehid = GetPlayerVehicleID(playerid);
    SetVehicleHealth(vehid, 1000.0);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
}
    if(strcmp("/policereports", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "Use /911 police [Then the number corresponding to the offense that you witnessed.");
    SendClientMessage(playerid, COLOR_WHITE, "187 - Homicide");
    SendClientMessage(playerid, COLOR_WHITE, "211 - Robbery");
    SendClientMessage(playerid, COLOR_WHITE, "487 - Grand Theft Auto");
    SendClientMessage(playerid, COLOR_WHITE, "510 - Speeding or racing vehicles");
    return 1;
}
    if(strcmp("/rules", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
    SendClientMessage(playerid, COLOR_WHITE, "1.No Death Matching");
    SendClientMessage(playerid, COLOR_WHITE, "2.Car Jacking is not allowed");
    SendClientMessage(playerid, COLOR_WHITE, "3.Do not disrespect other players.");
    SendClientMessage(playerid, COLOR_WHITE, "4.Do not spam or else you'll be muted/kicked!");
    SendClientMessage(playerid, COLOR_WHITE, "5.Hacks are not allowed here, except handling lines, BUT DRIFT ONLY!");
    SendClientMessage(playerid, COLOR_WHITE, "6.Respect the other players, and admins too.");
    SendClientMessage(playerid, COLOR_WHITE, "7.Ramming is not allowed.");
    SendClientMessage(playerid, COLOR_WHITE, "8.No glitches or exploits.");
    SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
    return 1;
}
    if(strcmp("/help", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
    SendClientMessage(playerid, COLOR_WHITE, "/report /rules /cars /dmlist /respawn");
    SendClientMessage(playerid, COLOR_WHITE, "/credits /buyproperty /kill /rdmtune");
    SendClientMessage(playerid, COLOR_WHITE, "/fixveh /neon /radio /sellproperty");
    SendClientMessage(playerid, COLOR_WHITE, "/admins /teleports /propertyinfo /policereports");
    SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
    return 1;
}
    if(strcmp("/credits", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "================Credits!=========================");
    SendClientMessage(playerid, COLOR_WHITE, "Code : [DDP]omgitsgodzilla");
    SendClientMessage(playerid, COLOR_WHITE, "Webdesign/code revision : [DDP]anthony");
    SendClientMessage(playerid, COLOR_WHITE, "Maps : [DDP]XerXioZ, kenny");
    SendClientMessage(playerid, COLOR_WHITE, "Everyone else at team DDP!");
    SendClientMessage(playerid, COLOR_WHITE, "Date server was finally complete Sunday, March, 4TH 2012, at 1:31 PM");
    SendClientMessage(playerid, COLOR_WHITE, "Current server build, V2.0!");
    SendClientMessage(playerid, COLOR_GREEN, "================Credits!=========================");
    return 1;
}
   
if(strcmp("/plant", cmdtext, true, 10) == 0)
    {
        GetPlayerPos(playerid, BombaX[playerid], BombaY[playerid], BombaZ[playerid]);
        bomb = CreatePlayerObject(playerid, 1252, BombaX[playerid]-0.5,BombaY[playerid],BombaZ[playerid]-0.5,0,-1,-1,-1);
        return 1;
    }
    if(strcmp("/kaboom", cmdtext, true, 10) == 0)
    {
        if(IsValidPlayerObject(playerid,bomb))
        {
            CreateExplosion(BombaX[playerid],BombaY[playerid],BombaZ[playerid], 2, 20.0);
            DestroyPlayerObject(playerid,bomb);
        }
        return 1;
    }
    if(strcmp("/defuse", cmdtext, true, 10) == 0)
    {
        DestroyPlayerObject(playerid,bomb);
        return 1;
    }
    if (strcmp(cmdtext, "/respawn", true)==0)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    SetPlayerInterior(playerid, 0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetVehiclePos(GetPlayerVehicleID(playerid), -2423.2783,-609.5183,132.5589);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 180.945861);
    return 1;
}
    else
{
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, -2423.2783,-609.5183,132.5589);
    SetPlayerFacingAngle(playerid, 180.945861);
    return 1;
}
}
    if(strcmp(cmdtext, "/healme", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetPlayerHealth(playerid, 100);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
    if(strcmp(cmdtext, "/lowgrav", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetGravity(0.004);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
/*  if(strcmp("/v hydra", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v hunter", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v rhino", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v seasparrow", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if (strcmp("/Colors", cmdtext, true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    ShowPlayerDialog(playerid, 24, DIALOG_STYLE_LIST, "Choose The Color WhatEver You Like", "Red\nBlue\nYellow\nGreen\nBlack\nPurple\nOrange\nBrown\nGray\nWhite\nGold\nPink\nSilver\nLightBlue\nGreenYellow\nDarkGreen\nLightYellow\nLightPink\nLightCoral\nDarkGray", "Select", "Cancel");
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}*/

    if(strcmp(cmdtext, "/normalgrav", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetGravity(0.008);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
    if (strcmp("/buyproperty", cmdtext, true) == 0)
{
    BuyPropertyForPlayer(playerid);
    return 1;
}
    if (strcmp("/sellproperty", cmdtext, true) == 0)
{
    SellPropertyForPlayer(playerid);
   
    return 1;
    }
    return 0;
}
to be honest im not even sure if its anything in "onplayercommandtext" it might be some were else. if you guys need to see anything else. just post here. thanks!


Re: all my commands have been disabled. help? - ViniBorn - 28.04.2012

Are you using FS?


Re: all my commands have been disabled. help? - xXitsgodzillaXx - 28.04.2012

yeah a few of em but they really dont interfeer (bad spelling ik) with the GM at least not that i know of. should i list them to you?


Re: all my commands have been disabled. help? - ViniBorn - 28.04.2012

Some of them don't use strcmp (Ex: ycmd, zcmd)?


Re: all my commands have been disabled. help? - xXitsgodzillaXx - 28.04.2012

Quote:
Originally Posted by Viniborn
View Post
Some of them don't use strcmp (Ex: ycmd, zcmd)?
its a mixture of both really. strcmp, YCMD, ECT.


Re: all my commands have been disabled. help? - Rudy_ - 28.04.2012

You can use either only Zcmd or Strcmp..


Re: all my commands have been disabled. help? - xXitsgodzillaXx - 28.04.2012

Quote:
Originally Posted by Rudy_
View Post
You can use either only Zcmd or Strcmp..
ive neve really had any problems with them till now. and do you mean like only use "ZCMD" FS's if my GM is made from ZCMD?


Re: all my commands have been disabled. help? - admantis - 28.04.2012

It can be that, or maybe your filterscripts are returning a different value on OnPlayerCommandText.


Re: all my commands have been disabled. help? - ViniBorn - 28.04.2012

Using these two types, you will have problems.
Convert one ...


Re: all my commands have been disabled. help? - Mean - 28.04.2012

I'm not sure, but if I remember good, you can't use spaces in commands, so you need to do it inside a command:
pawn Code:
if(!strcmp(cmdtext, "/911-police", true, 11)) {
    if(!strcmp(cmdtext[12], "187", true)) {  // If the player typed /911-police 187
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        SendClientMessage(playerid, -1, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
        format(string,sizeof string, "Police Dispatcher: All units, we have a Homicide at %s's location, Requesting EMS and Police for assistnace.",pName);
        SendClientMessageToAll(0xFF0000AA,string);
    }
    if(!strcmp(cmdtext[12], "211", true)) {  // If the player typed /911-police 211
        // blabla
    }
    return 1;
}
Been out of scripting for a while, but this code should work I guess.


Re: all my commands have been disabled. help? - xXitsgodzillaXx - 28.04.2012

so i played on my GM without ANY FS's and the commands still dont work. so now i know that its somthing in my GM. but idk what. :l


Re: all my commands have been disabled. help? - Rudy_ - 28.04.2012

Look for your last line of GM if it's return 0; change it to return 1; and if it's 1; then chang it to 0; and try


Re: all my commands have been disabled. help? - xXitsgodzillaXx - 28.04.2012

Quote:
Originally Posted by Rudy_
View Post
Look for your last line of GM if it's return 0; change it to return 1; and if it's 1; then chang it to 0; and try
are you talking about the LITERAL last line or the last line under "onplayercommandtext" ?


Re: all my commands have been disabled. help? - Rudy_ - 28.04.2012

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/911-police 187", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a Homicide at %s's location, Requesting EMS and Police for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 211", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a Robbery at %s's location, Requesting Police units for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 487", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have Grand theft Auto at %s's location, Requesting Police units for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 510", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a few Speeding or racing vehicles at %s's location, over.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/rdmtune", true) == 0)
{
    vehid = GetPlayerVehicleID(playerid);
    TuneVehicleRandomly(vehid);
    return 1;
}
    if (strcmp(cmdtext, "/radio", true) == 0)
{
    ShowPlayerDialog(playerid, radiodialog, DIALOG_STYLE_LIST, "Radio Stations", "Alternative\nClassic rock\nMetal\nTechno\nHiphop\nDubstep\nJazz\nReggae\nDancepunk\nAdultcomedy\nNewage\nFunk\nStopmusic", "Listen", "Cancel");
    return 1;
}
    if (strcmp(cmdtext, "/neon", true) == 0)
{
    if(IsPlayerInAnyVehicle(playerid))
{
    ShowPlayerDialog(playerid, neondialog, DIALOG_STYLE_LIST, "Neon Color", "DarkBlue\nRed\nGreen\nWhite\nViolet\nYellow\nCyan\nLightBlue\nPink\nOrange\nLightGreen\nLightYellow\nDelete Neon", "Select", "Cancel");
}
    return 1;
}
    if(strcmp("/fixveh", cmdtext, true) == 0)
{
    vehid = GetPlayerVehicleID(playerid);
    SetVehicleHealth(vehid, 1000.0);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
}
    if(strcmp("/policereports", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "Use /911 police [Then the number corresponding to the offense that you witnessed.");
    SendClientMessage(playerid, COLOR_WHITE, "187 - Homicide");
    SendClientMessage(playerid, COLOR_WHITE, "211 - Robbery");
    SendClientMessage(playerid, COLOR_WHITE, "487 - Grand Theft Auto");
    SendClientMessage(playerid, COLOR_WHITE, "510 - Speeding or racing vehicles");
    return 1;
}
    if(strcmp("/rules", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
    SendClientMessage(playerid, COLOR_WHITE, "1.No Death Matching");
    SendClientMessage(playerid, COLOR_WHITE, "2.Car Jacking is not allowed");
    SendClientMessage(playerid, COLOR_WHITE, "3.Do not disrespect other players.");
    SendClientMessage(playerid, COLOR_WHITE, "4.Do not spam or else you'll be muted/kicked!");
    SendClientMessage(playerid, COLOR_WHITE, "5.Hacks are not allowed here, except handling lines, BUT DRIFT ONLY!");
    SendClientMessage(playerid, COLOR_WHITE, "6.Respect the other players, and admins too.");
    SendClientMessage(playerid, COLOR_WHITE, "7.Ramming is not allowed.");
    SendClientMessage(playerid, COLOR_WHITE, "8.No glitches or exploits.");
    SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
    return 1;
}
    if(strcmp("/help", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
    SendClientMessage(playerid, COLOR_WHITE, "/report /rules /cars /dmlist /respawn");
    SendClientMessage(playerid, COLOR_WHITE, "/credits /buyproperty /kill /rdmtune");
    SendClientMessage(playerid, COLOR_WHITE, "/fixveh /neon /radio /sellproperty");
    SendClientMessage(playerid, COLOR_WHITE, "/admins /teleports /propertyinfo /policereports");
    SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
    return 1;
}
    if(strcmp("/credits", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "================Credits!=========================");
    SendClientMessage(playerid, COLOR_WHITE, "Code : [DDP]omgitsgodzilla");
    SendClientMessage(playerid, COLOR_WHITE, "Webdesign/code revision : [DDP]anthony");
    SendClientMessage(playerid, COLOR_WHITE, "Maps : [DDP]XerXioZ, kenny");
    SendClientMessage(playerid, COLOR_WHITE, "Everyone else at team DDP!");
    SendClientMessage(playerid, COLOR_WHITE, "Date server was finally complete Sunday, March, 4TH 2012, at 1:31 PM");
    SendClientMessage(playerid, COLOR_WHITE, "Current server build, V2.0!");
    SendClientMessage(playerid, COLOR_GREEN, "================Credits!=========================");
    return 1;
}
   
if(strcmp("/plant", cmdtext, true, 10) == 0)
    {
        GetPlayerPos(playerid, BombaX[playerid], BombaY[playerid], BombaZ[playerid]);
        bomb = CreatePlayerObject(playerid, 1252, BombaX[playerid]-0.5,BombaY[playerid],BombaZ[playerid]-0.5,0,-1,-1,-1);
        return 1;
    }
    if(strcmp("/kaboom", cmdtext, true, 10) == 0)
    {
        if(IsValidPlayerObject(playerid,bomb))
        {
            CreateExplosion(BombaX[playerid],BombaY[playerid],BombaZ[playerid], 2, 20.0);
            DestroyPlayerObject(playerid,bomb);
        }
        return 1;
    }
    if(strcmp("/defuse", cmdtext, true, 10) == 0)
    {
        DestroyPlayerObject(playerid,bomb);
        return 1;
    }
    if (strcmp(cmdtext, "/respawn", true)==0)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    SetPlayerInterior(playerid, 0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetVehiclePos(GetPlayerVehicleID(playerid), -2423.2783,-609.5183,132.5589);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 180.945861);
    return 1;
}
    else
{
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, -2423.2783,-609.5183,132.5589);
    SetPlayerFacingAngle(playerid, 180.945861);
    return 1;
}
}
    if(strcmp(cmdtext, "/healme", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetPlayerHealth(playerid, 100);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
    if(strcmp(cmdtext, "/lowgrav", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetGravity(0.004);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
/*  if(strcmp("/v hydra", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v hunter", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v rhino", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v seasparrow", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if (strcmp("/Colors", cmdtext, true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    ShowPlayerDialog(playerid, 24, DIALOG_STYLE_LIST, "Choose The Color WhatEver You Like", "Red\nBlue\nYellow\nGreen\nBlack\nPurple\nOrange\nBrown\nGray\nWhite\nGold\nPink\nSilver\nLightBlue\nGreenYellow\nDarkGreen\nLightYellow\nLightPink\nLightCoral\nDarkGray", "Select", "Cancel");
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}*/

    if(strcmp(cmdtext, "/normalgrav", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetGravity(0.008);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
    if (strcmp("/buyproperty", cmdtext, true) == 0)
{
    BuyPropertyForPlayer(playerid);
    return 1;
}
    if (strcmp("/sellproperty", cmdtext, true) == 0)
{
    SellPropertyForPlayer(playerid);
   
    return 1;
    }
   
}



Re: all my commands have been disabled. help? - xXitsgodzillaXx - 28.04.2012

Quote:
Originally Posted by Rudy_
View Post
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/911-police 187", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a Homicide at %s's location, Requesting EMS and Police for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 211", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a Robbery at %s's location, Requesting Police units for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 487", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have Grand theft Auto at %s's location, Requesting Police units for assistnace.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/911-police 510", true) == 0)
{
    new string[129], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    SendClientMessage(playerid, COLOR_WHITE, "Dispatcher: Ok, Please remain calm and stay at your location, assistance will be there shortly.");
    format(string,sizeof string, "Police Dispatcher: All units, we have a few Speeding or racing vehicles at %s's location, over.",pName);
    SendClientMessageToAll(0xFF0000AA,string);
    return 1;
}
    if(strcmp(cmdtext, "/rdmtune", true) == 0)
{
    vehid = GetPlayerVehicleID(playerid);
    TuneVehicleRandomly(vehid);
    return 1;
}
    if (strcmp(cmdtext, "/radio", true) == 0)
{
    ShowPlayerDialog(playerid, radiodialog, DIALOG_STYLE_LIST, "Radio Stations", "Alternative\nClassic rock\nMetal\nTechno\nHiphop\nDubstep\nJazz\nReggae\nDancepunk\nAdultcomedy\nNewage\nFunk\nStopmusic", "Listen", "Cancel");
    return 1;
}
    if (strcmp(cmdtext, "/neon", true) == 0)
{
    if(IsPlayerInAnyVehicle(playerid))
{
    ShowPlayerDialog(playerid, neondialog, DIALOG_STYLE_LIST, "Neon Color", "DarkBlue\nRed\nGreen\nWhite\nViolet\nYellow\nCyan\nLightBlue\nPink\nOrange\nLightGreen\nLightYellow\nDelete Neon", "Select", "Cancel");
}
    return 1;
}
    if(strcmp("/fixveh", cmdtext, true) == 0)
{
    vehid = GetPlayerVehicleID(playerid);
    SetVehicleHealth(vehid, 1000.0);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
}
    if(strcmp("/policereports", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "Use /911 police [Then the number corresponding to the offense that you witnessed.");
    SendClientMessage(playerid, COLOR_WHITE, "187 - Homicide");
    SendClientMessage(playerid, COLOR_WHITE, "211 - Robbery");
    SendClientMessage(playerid, COLOR_WHITE, "487 - Grand Theft Auto");
    SendClientMessage(playerid, COLOR_WHITE, "510 - Speeding or racing vehicles");
    return 1;
}
    if(strcmp("/rules", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
    SendClientMessage(playerid, COLOR_WHITE, "1.No Death Matching");
    SendClientMessage(playerid, COLOR_WHITE, "2.Car Jacking is not allowed");
    SendClientMessage(playerid, COLOR_WHITE, "3.Do not disrespect other players.");
    SendClientMessage(playerid, COLOR_WHITE, "4.Do not spam or else you'll be muted/kicked!");
    SendClientMessage(playerid, COLOR_WHITE, "5.Hacks are not allowed here, except handling lines, BUT DRIFT ONLY!");
    SendClientMessage(playerid, COLOR_WHITE, "6.Respect the other players, and admins too.");
    SendClientMessage(playerid, COLOR_WHITE, "7.Ramming is not allowed.");
    SendClientMessage(playerid, COLOR_WHITE, "8.No glitches or exploits.");
    SendClientMessage(playerid, COLOR_GREEN, "=================The Laws of The Land==================");
    return 1;
}
    if(strcmp("/help", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
    SendClientMessage(playerid, COLOR_WHITE, "/report /rules /cars /dmlist /respawn");
    SendClientMessage(playerid, COLOR_WHITE, "/credits /buyproperty /kill /rdmtune");
    SendClientMessage(playerid, COLOR_WHITE, "/fixveh /neon /radio /sellproperty");
    SendClientMessage(playerid, COLOR_WHITE, "/admins /teleports /propertyinfo /policereports");
    SendClientMessage(playerid, COLOR_GREEN, "====================Drift World==================");
    return 1;
}
    if(strcmp("/credits", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, COLOR_GREEN, "================Credits!=========================");
    SendClientMessage(playerid, COLOR_WHITE, "Code : [DDP]omgitsgodzilla");
    SendClientMessage(playerid, COLOR_WHITE, "Webdesign/code revision : [DDP]anthony");
    SendClientMessage(playerid, COLOR_WHITE, "Maps : [DDP]XerXioZ, kenny");
    SendClientMessage(playerid, COLOR_WHITE, "Everyone else at team DDP!");
    SendClientMessage(playerid, COLOR_WHITE, "Date server was finally complete Sunday, March, 4TH 2012, at 1:31 PM");
    SendClientMessage(playerid, COLOR_WHITE, "Current server build, V2.0!");
    SendClientMessage(playerid, COLOR_GREEN, "================Credits!=========================");
    return 1;
}
   
if(strcmp("/plant", cmdtext, true, 10) == 0)
    {
        GetPlayerPos(playerid, BombaX[playerid], BombaY[playerid], BombaZ[playerid]);
        bomb = CreatePlayerObject(playerid, 1252, BombaX[playerid]-0.5,BombaY[playerid],BombaZ[playerid]-0.5,0,-1,-1,-1);
        return 1;
    }
    if(strcmp("/kaboom", cmdtext, true, 10) == 0)
    {
        if(IsValidPlayerObject(playerid,bomb))
        {
            CreateExplosion(BombaX[playerid],BombaY[playerid],BombaZ[playerid], 2, 20.0);
            DestroyPlayerObject(playerid,bomb);
        }
        return 1;
    }
    if(strcmp("/defuse", cmdtext, true, 10) == 0)
    {
        DestroyPlayerObject(playerid,bomb);
        return 1;
    }
    if (strcmp(cmdtext, "/respawn", true)==0)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    SetPlayerInterior(playerid, 0);
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetVehiclePos(GetPlayerVehicleID(playerid), -2423.2783,-609.5183,132.5589);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 180.945861);
    return 1;
}
    else
{
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, -2423.2783,-609.5183,132.5589);
    SetPlayerFacingAngle(playerid, 180.945861);
    return 1;
}
}
    if(strcmp(cmdtext, "/healme", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetPlayerHealth(playerid, 100);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
    if(strcmp(cmdtext, "/lowgrav", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetGravity(0.004);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
/*  if(strcmp("/v hydra", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v hunter", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v rhino", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if(strcmp("/v seasparrow", cmdtext, true))
{
    SendClientMessage(playerid,COLOR_RED,"ERROR: This Vehicle is for VIPs only!");
    return 1;
}
    if (strcmp("/Colors", cmdtext, true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    ShowPlayerDialog(playerid, 24, DIALOG_STYLE_LIST, "Choose The Color WhatEver You Like", "Red\nBlue\nYellow\nGreen\nBlack\nPurple\nOrange\nBrown\nGray\nWhite\nGold\nPink\nSilver\nLightBlue\nGreenYellow\nDarkGreen\nLightYellow\nLightPink\nLightCoral\nDarkGray", "Select", "Cancel");
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}*/

    if(strcmp(cmdtext, "/normalgrav", true) == 0)
{
    if(IsPlayerVipType(playerid, 3))
    SetGravity(0.008);
    else SendClientMessage(playerid, COLOR_RED, "ERROR: You are not a VIP!");
    return 1;
}
    if (strcmp("/buyproperty", cmdtext, true) == 0)
{
    BuyPropertyForPlayer(playerid);
    return 1;
}
    if (strcmp("/sellproperty", cmdtext, true) == 0)
{
    SellPropertyForPlayer(playerid);
   
    return 1;
    }
   
}
Quote:

warning 209: function "OnPlayerCommandText" should return a value

id have to keep return 0; on there. idk why lol


Re: all my commands have been disabled. help? - Mean - 28.04.2012

First of all, do any other commands work? Simple ones?
Second of all, indent the code so we can read it properly.


Re: all my commands have been disabled. help? - Scenario - 28.04.2012

You can't have spaces in a command.


Re: all my commands have been disabled. help? - Mean - 28.04.2012

Quote:
Originally Posted by RealCop228
View Post
You can't have spaces in a command.
Seems he didn't bother reading my reply then.


Re: all my commands have been disabled. help? - xXitsgodzillaXx - 28.04.2012

Quote:
Originally Posted by Mean
View Post
First of all, do any other commands work? Simple ones?
Second of all, indent the code so we can read it properly.
all the commands with my FS's work thats it.

Quote:
Originally Posted by RealCop228
View Post
You can't have spaces in a command.
im aware of this

Quote:
Originally Posted by Mean
View Post
Seems he didn't bother reading my reply then.
and i already tried what you posted didnt help me. but im still using it cause its a bit shorter for length (dont ask lol)


Re: all my commands have been disabled. help? - xXitsgodzillaXx - 29.04.2012

ok good news, i hit a double whammy. i converted ALL the commands to ZCMD and they work! good bye STRCMP!