HELP ASAP!!!! SOMETHING SIMPLY INVISIBLE!!
#1

I am working on a huge roleplay script and getting far i had already got this code to work and when i went to test it earlier today, it keeps giving me (SERVER: Unknown Command)s. I even got rid of the range requirements and everything and it still doesn't work, used multiple names to see if i do something wrong there no luck. Also, if i were to fix line 92 it would come up on all the string declaration lines, but i assume it's the same error.

I placed this code in OnPlayerCommand and i honestly have no idea what the problem is, has the size of string changed recently possibly or something?
Quote:

if (strcmp("/dvbuy", cmdtext, true, 10) == 0){
new stringall[2000];

new string1[512] = "Admiral - $000,000\r\nBF 400 - $000,000\r\nBlade - $000,000\r\nBlista Compact - $000,000\r\nBobcat - $000,000\r\nBravura - $000,000\r\nBroadway - $000,000\r\nBuccaneer - $000,000\r\nBuffalo - $000,000\r\nBurrito - $000,000\r\nCadrona - $000,000\r\nCheetah - $000,000\r\nClover - $000,000\r\nClub - $000,000\r\nComet - $000,000\r\nElegant - $000,000\r\nElegy - $000,000\r\nEmperor - $000,000\r\n";

new string2[512] = "Esperanto - $10,000\r\nEuros - $000,000\r\nFaggio - $000,000\r\nFBI Rancher - $000,000\r\nFeltzer - $000,000\r\nFlash - $000,000\r\nFortune - $000,000\r\nFreeway - $000,000\r\nGreenwood - $000,000\r\nHotknife - $000,000\r\nHuntley - $000,000\r\nHustler - $000,000\r\nIntruder - $000,000\r\nJester - $000,000\r\nLandstalker - $000,000\r\nMajestic - $000,000\r\nManana - $000,000\r\nMerit - $000,000\r\nMesa - $000,000\r\nMoonbeam - $000,000\r\n";

new string3[512] = "Nebula - $000,000\r\nPCJ 600 - $000,000\r\nPicador - $000,000\r\nPolice Car - $000,000\r\nPolice Maverick - $000,000\r\nPolice Ranger - $000,000\r\nPony - $000,000\r\nPremier - $000,000\r\nPrevion - $000,000\r\nPrimo - $000,000\r\nRancher - $000,000\r\nRemington - $000,000\r\nRomero - $000,000\r\nSabre - $000,000\r\nSadler - $000,000\r\nSavanna - $000,000\r\nSentinel - $000,000\r\nSlamvan - $000,000\r\nSolair - $000,000\r\nSparrow - $000,000\r\n";

new string4[512] = "Stafford - $000,000\r\nStallion - $000,000\r\nStratum - $000,000\r\nStretch - $000,000\r\nSultan - $000,000\r\nSunrise - $000,000\r\nSwat Enforcer - $000,000\r\nTahoma - $000,000\r\nTampa - $000,000\r\nTaxi - $000,000\r\nTornado - $000,000\r\nTowtruck - $000,000\r\nUranus - $000,000\r\nVincent - $000,000\r\nVirgo - $000,000\r\nVoodoo - $000,000\r\nWashington - $000,000\r\nWayfarer - $000,000\r\nWillard - $000,000\r\nWindsor - $000,000\r\nYosemite - $000,000";

format(stringall,sizeof(stringall),"%s%s%s%s",stri ng1,string2,string3,string4);

ShowPlayerDialog(playerid,DEALER_BUYCAR,DIALOG_STY LE_LIST,"Dealer Auction",stringall,"Buy","Cancel");

return 1;
}

NO COMPILE ERRORS!!!!
Reply
#2

an if statement needs to be followed by {}
Reply
#3

Quote:
Originally Posted by cessil
Посмотреть сообщение
an if statement needs to be followed by {}
Oh yea sorry i accidently missed that on the copy here is the correct script.

Quote:
Quote:

if (strcmp("/dvbuy", cmdtext, true, 10) == 0){
new stringall[2000];

//if((IsPlayerInRangeOfPoint(playerid,3,-1945.1776,256.1526,41.0471)) && (DCarCount[playerid] < MAX_DEALERCARS)){

new string1[512] = "Admiral - $000,000\r\nBF 400 - $000,000\r\nBlade - $000,000\r\nBlista Compact - $000,000\r\nBobcat - $000,000\r\nBravura - $000,000\r\nBroadway - $000,000\r\nBuccaneer - $000,000\r\nBuffalo - $000,000\r\nBurrito - $000,000\r\nCadrona - $000,000\r\nCheetah - $000,000\r\nClover - $000,000\r\nClub - $000,000\r\nComet - $000,000\r\nElegant - $000,000\r\nElegy - $000,000\r\nEmperor - $000,000\r\n";

new string2[512] = "Esperanto - $10,000\r\nEuros - $000,000\r\nFaggio - $000,000\r\nFBI Rancher - $000,000\r\nFeltzer - $000,000\r\nFlash - $000,000\r\nFortune - $000,000\r\nFreeway - $000,000\r\nGreenwood - $000,000\r\nHotknife - $000,000\r\nHuntley - $000,000\r\nHustler - $000,000\r\nIntruder - $000,000\r\nJester - $000,000\r\nLandstalker - $000,000\r\nMajestic - $000,000\r\nManana - $000,000\r\nMerit - $000,000\r\nMesa - $000,000\r\nMoonbeam - $000,000\r\n";

new string3[512] = "Nebula - $000,000\r\nPCJ 600 - $000,000\r\nPicador - $000,000\r\nPolice Car - $000,000\r\nPolice Maverick - $000,000\r\nPolice Ranger - $000,000\r\nPony - $000,000\r\nPremier - $000,000\r\nPrevion - $000,000\r\nPrimo - $000,000\r\nRancher - $000,000\r\nRemington - $000,000\r\nRomero - $000,000\r\nSabre - $000,000\r\nSadler - $000,000\r\nSavanna - $000,000\r\nSentinel - $000,000\r\nSlamvan - $000,000\r\nSolair - $000,000\r\nSparrow - $000,000\r\n";

new string4[512] = "Stafford - $000,000\r\nStallion - $000,000\r\nStratum - $000,000\r\nStretch - $000,000\r\nSultan - $000,000\r\nSunrise - $000,000\r\nSwat Enforcer - $000,000\r\nTahoma - $000,000\r\nTampa - $000,000\r\nTaxi - $000,000\r\nTornado - $000,000\r\nTowtruck - $000,000\r\nUranus - $000,000\r\nVincent - $000,000\r\nVirgo - $000,000\r\nVoodoo - $000,000\r\nWashington - $000,000\r\nWayfarer - $000,000\r\nWillard - $000,000\r\nWindsor - $000,000\r\nYosemite - $000,000";

format(stringall,sizeof(stringall),"%s%s%s%s",stri ng1,string2,string3,string4);
//}

ShowPlayerDialog(playerid,DEALER_BUYCAR,DIALOG_STY LE_LIST,"Dealer Auction",stringall,"Buy","Cancel");
//}

//else{
//SendClientMessage(playerid, COLOR_RED, "You are out of range or have reached your dealer maximum.");
//}
// Do something here
return 1;
}

Reply
#4

also you can't format 512*4 into a 2000 sized array
Reply
#5

pawn Код:
format(stringall,sizeof(stringall),"%s%s%s%s",stri ng1,string2,string3,string4);
Change to:
pawn Код:
format(stringall,sizeof(stringall),"%s%s%s%s",string1,string2,string3,string4);
Reply
#6

why not just use the one string and use strcat?
Reply
#7

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
pawn Код:
format(stringall,sizeof(stringall),"%s%s%s%s",stri ng1,string2,string3,string4);
Change to:
pawn Код:
format(stringall,sizeof(stringall),"%s%s%s%s",string1,string2,string3,string4);
sorry typo in copy i dont know why it did that.

Quote:

To cessil: why not just use the one string and use strcat?

I mean i guess i could back when i first wrote it i didn't know what strcat was. but i tried it in a new script and it worked just fine, think my script is too long or something? i have 6327 lines total? i don't understand i put it in new script and it worked then i pasted into my larger full roleplay script and it gives me the Unknowns again...

I don't understand why it singles out this one command though, all my dealer system commands that surround the buy dialog work fine like they should and always have...
Reply
#8

a script has a huge limit of lines and i can assure you your script isnt to long there are RP scripts with lets say 80 -90k lines you have 6k lines check yor script for multiple definions and multiple defines of strings or post your errors and lines here
Reply
#9

Thanks for everyones help, i appreciated all replies.
[SOLVED] What I did was i made multiple methods, of the full scripts for each job, each huge, but in the end after about 20 mins of organizing to make my onplayercommand smaller, it worked once i seperated all the jobs out. I figure it was a small error because my onplayercommand was just holding too much that it kinda got confused, my jobs are intricate so.

THANKS AGAIN! BEEEEEE EEEEEEASY!!!
Reply
#10

You replied just before I got the chance to :c
but I'll still post this:
Quote:
Originally Posted by BeEasy114
Посмотреть сообщение
I placed this code in OnPlayerCommand and i honestly have no idea what the problem is, has the size of string changed recently possibly or something?
Check SA-MP Limits
As you can see the max string size is 1024 characters.

I don't really understand why you're concatenating 4 strings into one when you could just use one string. format takes time. Time your server may need. Sure, it's negligible for one command use but if the command was called a couple of thousand times it's an entirely different ball game.

Glad to see you've figured it out, however, hope all goes well.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)