Two problems about sa-mp
#1

Hi,i developed a car system.System moves like this;
Game selects a random car,creates a checkpoint when you bring the car at checkpoint it gives you money.

For learning which car is wanted,i developed a wanted car command.But there is weirdness it says
SERVER: Unknown command.
But this is impossible because my commandtext return is like this:
pawn Код:
return ShowPlayerDialog(playerid,1234,DIALOG_STYLE_MSGBOX,"Info","Command is unknown,please use /help","OK","");
I checked 1000 times,there is no return 0; in OnPlayerCommandText :S

I spoke too much,that's the code;
pawn Код:
if(!strcmp(cmdtext,"/wantedcar",true))
{
        new zalamsucuk[128];
        format(zalamsucuk,128,"The wanted car is %s,you will get $%d when you bring it.\n",VehicleNames[carid-400],carprice);
        ShowPlayerDialog(playerid,3440,DIALOG_STYLE_MSGBOX,"Wanted Car",zalamsucuk,"OK","");
        return 1;
}

And the other problem is,when i write '%' in-game chat,it shows like #,why is this? :S
Reply
#2

Do you have filterscripts? There it could be returned 0;
Reply
#3

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
Do you have filterscripts? There it could be returned 0;
I'm not using filterscripts.I'm combining them with my GM.
Reply
#4

Try this to remove SERVER:Unknown command

With error message:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   // codes here
   return SendClientMessage(playerid, color, "Blah blah blah");
}
Without error message:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   // codes here
   return 1;
}
[EDIT: FORGOT ; AFTER 1]
Reply
#5

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
Try this to remove SERVER:Unknown command

With error message:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   // codes here
   return SendClientMessage(playerid, color, "Blah blah blah");
}
Without error message:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   // codes here
   return 1
}
Error: Line not closed "return 1".


pawn Код:
if(strcmp(cmdtext,"/wantedcar",true) == 0)
{
        new zalamsucuk[128];
        format(zalamsucuk,128,"The wanted car is %s,you will get $%d when you bring it.\n",VehicleNames[carid-400],carprice);
        ShowPlayerDialog(playerid,3440,DIALOG_STYLE_MSGBOX,"Wanted Car",zalamsucuk,"OK","");
        return 1;
}
If that doesn't work, please post the VehicleNames and carid definitions etc.

NOTE: It most likely or definitely will not work xD Please post your definitions.

Oh, and SAMP does not support the character '%'. This is normal and happens in every server, do not worry about it, might be fixed in later versions of 0.3e or 0.3f+.
Reply
#6

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
Error: Line not closed "return 1".


pawn Код:
if(strcmp(cmdtext,"/wantedcar",true) == 0)
{
        new zalamsucuk[128];
        format(zalamsucuk,128,"The wanted car is %s,you will get $%d when you bring it.\n",VehicleNames[carid-400],carprice);
        ShowPlayerDialog(playerid,3440,DIALOG_STYLE_MSGBOX,"Wanted Car",zalamsucuk,"OK","");
        return 1;
}
If that doesn't work, please post the VehicleNames and carid definitions etc.

NOTE: It most likely or definitely will not work xD Please post your definitions.

Oh, and SAMP does not support the character '%'. This is normal and happens in every server, do not worry about it, might be fixed in later versions of 0.3e or 0.3f+.
Try it now!
Reply
#7

In beginning of gm;
pawn Код:
new carid,carprice;
That's vehiclenames :
pawn Код:
new VehicleNames[212][] = {
    "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
    "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taksi","Washington","Bobcat","Mr Whoopee","BF Injection",
    "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
    "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
    "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
    "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
    "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
    "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
    "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
    "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
    "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
    "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
    "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
    "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
    "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Polis Araci","Police Araci",
    "Police Araci","Polis Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
    "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
That's the choosing car func:
pawn Код:
public ChooseVeh()
{
new Cars[38] = {418, 404, 479, 458, 561, 602, 429, 496, 402, 541, 415, 589, 587, 565, 494, 502, 503, 411, 559, 603, 475, 506, 451, 558, 477, 480, 533, 439, 555, 536, 575, 534, 567, 535, 566, 576, 412};
new rmb = random(sizeof(Cars));
new arac7[32],yazixd[128];
carprice = CAR_MINPRICE + random(CAR_MAXPRICE - CAR_MINPRICE);
carid = Cars[rmb];
//Done choosing,lets notice it :D
format(arac7,32,"%s",VehicleNames[carid-400]);
format(yazixd,128,"Gallery wants %s now,if you bring it,you will earn $%d.",arac7,carprice);
SendClientMessageToAll(green,yazixd);
return 1;
}
Reply
#8

I believe occasionally that, dialogs refuse to consent return 1, try return 0 and see if it makes any difference.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)