3D text toggle Help PLEASE - 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)
+--- Thread: 3D text toggle Help PLEASE (
/showthread.php?tid=417764)
3D text toggle Help PLEASE -
Brandon_More - 22.02.2013
Код:
new tempID[128];
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
new pID[128];
pID = strtok(cmdtext, idx);
if (strcmp(cmd,"/oocmode", true) == 0)
{
if(strlen(pID) == 0) return SendClientMessage(playerid, 0xE3E3E3FF, "USAGE: /oocmode [playerid]");
if( omode == 0 )
{
new Text3D:label = Create3DTextLabel("DO NOT ROLEPLAY WITH THIS PERSON!\nTHIS PERSON IS IN OOC MODE!", COLOR_LIGHTGREEN, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, strval(pID), 0.0, 0.0, 0.7);
SendClientMessage(strval(pID), COLOR_LIGHTGREEN, "(Info): You are now in OOC mode, you may not roleplay with anybody!");
omode = 1;
strcat(tempID, pID); // Here I put pID value in tempID, maybe I am doing it wrongly?
}
else if( omode == 1 )
SendClientMessage(playerid, COLOR_ERROR, "ERROR: There is currently a player using OOC mode, you may not use it now!");
else if( omode == 1 && tempID[] == pID[] )
{
omode = 0;
Delete3DTextLabel(Text3D:0);
}
return 1;
}
}
Код:
ERRORS: C:\Users\haim\Desktop\Script\gamemodes\Untitled.pwn(195) : error 033: array must be indexed (variable "tempID")
C:\Users\haim\Desktop\Script\gamemodes\Untitled.pwn(195) : error 033: array must be indexed (variable "pID")
Re: 3D text toggle Help PLEASE -
Brandon_More - 22.02.2013
I want it to check if tempID = to pID and if yes to disable the text 3D. Although I got everything except how to check if they are equal.
Re: 3D text toggle Help PLEASE -
Denying - 24.02.2013
if( tempID == strval(pID)) ?
Hope I helped.
Re: 3D text toggle Help PLEASE -
Brandon_More - 24.02.2013
Thanks. Rep+