Hmm hier,
ungetestet - sollte eig. klappten :>
jedoch brauchst du strtok
if(strcmp(cmdtext,"/heilen",true) == 0)
{
if(gTeam[playerid] == TEAM_MEDIC)
{
new tmp[64],id;
tmp=strtok(cmdtext,idx);
id=strval(tmp);
new heilname[MAX_PLAYER_NAME],artzt[MAX_PLAYER_NAME];
GetPlayerName(playerid,artzt,sizeof(artzt));
GetPlayerName(id,heilname,sizeof(heilname));
new string [123];
{
GetPlayerName(playerid,heilname,sizeof(heilname));
format(string,sizeof(string),"Arzt: %s wurde von %s geheilt!",heilname,artzt);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SetPlayerHealth(id,100);
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Du bist nicht im Sanitäter Team!");
}
return 1;
}
Das iwo im script:
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;
}
bei OnPlayerCommandText:
new cmd[64],idx;
cmd = strtok(cmdtext, idx);
lg