PDA

View Full Version : Command returning empty?


batonsa
16/11/2013, 09:44 AM
Hello guys,

Yesterday i spent like 2 hours writing and trying to get this part of my vehicle script to work.

Any ideas why this string is returning empty?


new carlist1;
new insurancea1[20];
new alarma1[10];
new locka1[10];
carlist1 = PlayerInfo[playerid][pCarkey];
if(PlayerInfo[playerid][pCarkey] == 2001)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have a vehicle in slot 1");
return 1;
}
else
{
if(CarInfo[carlist1][cInsurance] == 0) { insurancea1 = "None"; }
else if(CarInfo[carlist1][cInsurance] == 1) { insurancea1 = "Classic"; }
else if(CarInfo[carlist1][cInsurance] == 2) { insurancea1 = "Advanced"; }
if(CarInfo[carlist1][cAlarm] == 0) { alarma1 = "None"; }
else if(CarInfo[carlist1][cAlarm] == 1) { alarma1 = "None"; }
else if(CarInfo[carlist1][cAlarm] == 2) { alarma1 = "SecuTech"; }
else if(CarInfo[carlist1][cAlarm] == 3) { alarma1 = "XSA"; }
if(CarInfo[carlist1][cInsurance] == 0) { insurancea1 = "None"; }
else if(CarInfo[carlist1][cInsurance] == 1) { insurancea1 = "Classic"; }
else if(CarInfo[carlist1][cInsurance] == 2) { insurancea1 = "Advanced"; }
if(CarInfo[carlist1][cLock] == 0) { locka1 = "No"; }
else if(CarInfo[carlist1][cLock] == 0) { locka1 = "Yes"; }
new string[256];
format(string,sizeof(string),"1) {33CCFF}Model:{FFFFFF} %s | {33CCFF}Fuel:{FFFFFF} %d l | {33CCFF}Locked:{FFFFFF} %s | {33CCFF}Insurance:{FFFFFF} %s | {33CCFF}Alarm:{FFFFFF} %s ", CarInfo[carlist1][cDescription], CarInfo[carlist1][cFuel] ,locka1, insurancea1, alarma1);
SendClientMessage(playerid, COLOR_WHITE ,string);
}



Note: Yes, I wrote this script on my own, and no, i wont ever fully adapt zcmd or sscanf, im old-fashioned :)

David (Sabljak)
16/11/2013, 11:01 AM
Too much colors on {COLOR} i think

Konstantinos
16/11/2013, 11:06 AM
Too much colors on {COLOR} i think

David is correct. A quote from SA-MP Wiki:


Important Notes:

If a message is longer than 144 characters, it will not be sent.

batonsa
16/11/2013, 12:11 PM
Thanks guys, you are awesome =)