IDK what to do at this point. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IDK what to do at this point. (
/showthread.php?tid=77732)
IDK what to do at this point. -
FreeSoul - 14.05.2009
I have the CMD.
Код:
if(strcmp(cmd, "/walkietalkie", true) == 0 || strcmp(cmd, "/wt", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new freq = PlayerInfo[playerid][pWalkieFreq];
new length = strlen(cmdtext);
if(PlayerInfo[playerid][pWalkieFreq] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, " You must set your frequence first");
return 1;
}
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /wt [Message]");
return 1;
}
if(PlayerInfo[playerid][pWalkie] == 1)
{
format(string, sizeof(string), "** Walkie Talkie Chat[%d] %s: %s **",freq, sendername, result);
SendWalkieTalkieChatMessage(freq,COLOR_YELLOW, string);
printf("%s", string);
if(MedicBill[playerid] == 0)
{
new time = idx * 100;
SetTimerEx("ClearChat",time,0,"d",playerid);
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You must have a WalkieTalkie!");
return 1;
}
}
return 1;
}
The function SendWalkieTalkieChatMessage is not implemented.I have it at forward.
Код:
forward SendWalkieTalkieChatMessage(freq, color, string[]);
Was not made by me,a friend send it to me via yahoo,but he doesn't know what to do either.
Thanks and have a nice day/night
Re: IDK what to do at this point. -
Backwardsman97 - 14.05.2009
You still have to declare the function elsewhere. Post the function.
Re: IDK what to do at this point. -
FreeSoul - 14.05.2009
Where somewhere else? Usually I declare it just at the forwards.Where should I declare it again?
Re: IDK what to do at this point. -
Backwardsman97 - 14.05.2009
Yes, you need to forward public functions but you also have to put the actual function in there.
pawn Код:
forward ExitServer();
public ExitServer()
{
SendRconCommand("exit");
return 1;
}
//Just an example of a public function.
You only have the forward part. You need the actual function.
Re: IDK what to do at this point. -
FreeSoul - 14.05.2009
Ok thanks a lot ^^
Re: IDK what to do at this point. -
Backwardsman97 - 14.05.2009
No prob.