coding help -
nickstar - 08.10.2012
ok i am trying to make a tlaws command
like this but i dont if it is right and when i put it under "public OnPlayerCommandText(playerid, cmdtext[])"
the cleo compiler does not respond and does not work
maybe tv help will work
this is the code
Code:
if(strcmp(cmdtext, "/tlaws"))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Always stop at red lights");
SendClientMessage(playerid, 0xFFFFFFFF, "Don't act like a goverment first responder");
SendClientMessage(playerid, 0xFFFFFFFF, "Don't race on any road unless you get a permit from the goverment");
SendClientMessage(playerid, 0xFFFFFFFF, "Make sure you always drive on the right side of the road unless permited");
SendClientMessage(playerid, 0xFFFFFFFF, "Speed limits-50 KPH unpaved Roads,35 KPH Construction Zones,");
SendClientMessage(playerid, 0xFFFFFFFF, "85 KPH Two Lane City Roads,110 MPH on Highways, Freeways, Interstates");
return 1;
}
return 0;
}
Re : coding help -
lelemaster - 08.10.2012
Quote:
Originally Posted by nickstar
ok i am trying to make a tlaws command
like this but i dont if it is right and when i put it under "public OnPlayerCommandText(playerid, cmdtext[])"
the cleo compiler does not respond and does not work
maybe tv help will work
this is the code
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/tlaws", true)) { SendClientMessage(playerid, 0xFFFFFFFF, "Always stop at red lights"); SendClientMessage(playerid, 0xFFFFFFFF, "Don't act like a goverment first responder"); SendClientMessage(playerid, 0xFFFFFFFF, "Don't race on any road unless you get a permit from the goverment"); SendClientMessage(playerid, 0xFFFFFFFF, "Make sure you always drive on the right side of the road unless permited"); SendClientMessage(playerid, 0xFFFFFFFF, "Speed limits-50 KPH unpaved Roads,35 KPH Construction Zones,"); SendClientMessage(playerid, 0xFFFFFFFF, "85 KPH Two Lane City Roads,110 MPH on Highways, Freeways, Interstates"); return 1; } return 0; }
|
Yes, you place it in OnPlayerCommandText. Wait what? Cleo compiler?
Re: coding help -
nickstar - 08.10.2012
opps lol i mean pawno but i did place it there and when i compiled it my compiler would not respond
Re : coding help -
lelemaster - 08.10.2012
Are you sure it's from those codes? Copy paste the one that I made in your quote. It should not gives you error those codes, it's just SendClientMessage and there's nothing wrong.
Edit: What codes did you do before those one?
Re: coding help -
nickstar - 08.10.2012
i am not getting any errors but when i compile it after a few seconds the compiler does not respond and i have to close he compiler but when i take out that code it compiles fine
http://prntscr.com/h050d
Re : coding help -
lelemaster - 08.10.2012
When it stops compiling it's because you have so much errors. Just take a look where you placed all dcmd. You placed them under OnPlayerCommandText, not in.
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/tlaws", true))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Always stop at red lights");
SendClientMessage(playerid, 0xFFFFFFFF, "Don't act like a goverment first responder");
SendClientMessage(playerid, 0xFFFFFFFF, "Don't race on any road unless you get a permit from the goverment");
SendClientMessage(playerid, 0xFFFFFFFF, "Make sure you always drive on the right side of the road unless permited");
SendClientMessage(playerid, 0xFFFFFFFF, "Speed limits-50 KPH unpaved Roads,35 KPH Construction Zones,");
SendClientMessage(playerid, 0xFFFFFFFF, "85 KPH Two Lane City Roads,110 MPH on Highways, Freeways, Interstates");
return 1;
}
dcmd(xgoto,5,cmdtext);//and so on
dcmd(gpsfind,7,cmdtext);
return 0;
}
I'm not sure how you should place all the dcmds because I'm actually using ZCMD, but try it that way.
Edit: The codes written above OnPlayerCommandText, I think it should return a value.
Re: coding help -
nickstar - 08.10.2012
ok i pasted those
still got this
http://prntscr.com/h05i1
here is what it looks like
http://prntscr.com/h05kw
Re : coding help -
lelemaster - 08.10.2012
Are you fooling me? If you have TV, send me a PM of user and password, I can't imagine that you don't understand.
Re : coding help -
lelemaster - 08.10.2012
Thread closed, all was done on teamviewer.