28.04.2012, 15:00
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!
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!
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;
}
thanks!



good bye STRCMP!